The GcMultiRow control allows you to disable specific cells. The user is not allowed to input into or click the cells that are disabled. Also, the appearance of these disabled cells can be changed.
Disabling cells differs from Restricting Cell Selection, as the cell appearance can be changed, and cell movement or selection is allowed in disabled cells. The appearance of disabled cells differs according to the implementation of Cell Styles and cell types.
![](images/hs-note.gif) |
It is not possible to set a disabled appearance for rows. In this case, all the cells in that row need to be disabled. |
Using Code
The following code disables the second cell in the first row. The background color has been changed to differentiate between the cells.
[VB]
GcMultiRow1.Rows(0).Cells(1).Style.BackColor = Color.NavajoWhite
GcMultiRow1.Rows(0).Cells(1).Enabled = False
|
[CS]
gcMultiRow1.Rows[0].Cells[1].Style.BackColor = Color.NavajoWhite;
gcMultiRow1.Rows[0].Cells[1].Enabled = false;
|
The following code enables (removes the disabled state) for the second cell in the first row. By default, all the cells are enabled.
[VB]
GcMultiRow1.Rows(0).Cells(1).Enabled = True
|
[CS]
gcMultiRow1.Rows[0].Cells[1].Enabled = true;
|
See Also