'宣言 Sub Setup( _ ByVal parentGrid As C1FlexGrid, _ ByVal rowIndex As System.Integer _ )
void Setup( C1FlexGrid parentGrid, System.int rowIndex )
パラメータ
- parentGrid
- FlexGrid which displays detail control.
- rowIndex
- Index of parent detail row.
'宣言 Sub Setup( _ ByVal parentGrid As C1FlexGrid, _ ByVal rowIndex As System.Integer _ )
void Setup( C1FlexGrid parentGrid, System.int rowIndex )
This method can be used to setup data binding or other properties of the detail control.
The parameters of this method contain instance of parent C1FlexGrid and row index. The row index can be used to determine the right index of data object in grid data source.
void IC1FlexGridRowDetail.Setup(C1FlexGrid parentGrid, int rowIndex) { // initialize BindingSource object from parent grid's data source var bs = new BindingSource(parentGrid.DataSource as DataSet, "Employees"); // retrieve and assign right position of data object in the parent grid's data source bs.Position = parentGrid.Rows[rowIndex].DataIndex; // assign corresponding data field DataField = "Notes"; // assign setup BindingSource object as data source DataSource = bs; }