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");
}
}