NetAdvantage控制項使用:UltraGrid

來源:互聯網
上載者:User
1。添加Column
Start\Basic Settings\Data Schema\Manually Define a Schema\添加Column,命名用資料庫中的欄位名。

2。添加Column中文名稱
Band and Column Settings\Band [0](手動添加Column後)\Columns\選擇列\Header\修改Caption屬性

3。整個表的屬性在Basic Settings或職能按鈕中修改;單列的屬性在Band中修改。

4。Basic Settings中Data Schema用於設定資料列;Presets用於調整樣式;Picker用於定義一些選項屬性。

5。綁定資料
this.ultraGrid1.DataSource = myDataSet.Tables[0];
資料列也可以在DataTable中設定,Column[0].ColumnName或Column[0].Caption

6。Header換行
智能按鈕/Wrap Header Text 設為true,預設為不換行的

7。排序:Picker/Filtring/Allow
8。分組:Picker/OutLook GroupBy/Active
9。編輯:Picker/Update
10。多行表頭:Column Arrangement Designer/Add Group/Add Level/把相應的列拖到組下面,
11。隱藏列:Column Arrangement Designer/Show Hide
12。單列不可編輯:Band[0]/Column/AllowEdit
13。單擊儲存格選擇狀態:Band[0]/Column/CellClickAction
14。繫結控制項:Band[0]/Column/EditorControl
15。儲存格合并:Band[0]/Column/MergedCell。。。
16。定住不滾動列:Picker/Fixed Header
17。增加行:
this.ultraGrid1.Rows.Band.AddNew();
this.ultraGrid1.Rows[this.ultraGrid1.Rows.Count - 1].Cells["REC_ID"].Value = CommomFun.GetID();
18。刪除行:
if (this.ultraGrid1.Rows.Count <= 0)
                {
                    MessageInfo.ShowMessage("m_system_client_0009");
                    return ;
                }
                #endregion
                if (this.ultraGrid1.ActiveRow != null)
                {
                    this.ultraGrid1.ActiveRow.Selected = true;
                }
                if (MessageInfo.ShowMessage("m_system_client_0003", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    bool blnDeleted = false;
                    for (int i = 0; i < this.ultraGrid1.Rows.Count; i++)
                    {
                        if (this.ultraGrid1.Rows[i].Selected || this.ultraGrid1.Rows[i].IsActiveRow)
                        {
                            if (this.ultraGrid1.Rows[i].Delete(false))
                            {
                                i--;
                            }
                            blnDeleted = true;
                        }
                    }
                  
                    if (!blnDeleted)
                    {
                        MessageInfo.ShowMessage("m_system_client_0009");
                    }
                }

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.