When the grid contains both horizontal and vertical splits, it is said to be organized in a two-dimensional split matrix. Reference and access to the properties of the split objects in the matrix is accomplished with a two-dimensional matrix notation. The index for a particular split in a split matrix is the split row, then the column delimited by a comma. For instance, accessing the second vertical split (column) in the third horizontal split (row) would look like the following:
C# |
Copy Code
|
---|---|
this.c1TrueDBGrid1.Splits[2, 1].Style.BackColor = System.Drawing.Color.Red;
|
The resulting output will be as follows:
For instance, accessing the second split in a grid with only horizontal splits would look like the following:
C# |
Copy Code
|
---|---|
this.c1TrueDBGrid1.Splits[1].Style.BackColor = System.Drawing.Color.LightSeaGreen;
|
The resulting output will be as follows: