NetAdvantage控件使用:UltraGrid

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");
                    }
                }
posted @ 2006-11-22 16:51  疯一样的自由  阅读(3051)  评论(5编辑  收藏  举报