GcMultiRow lets you restrict the selection of specific cells. Cells with restricted selection cannot be selected either by the keyboard or mouse or by using code. You might want to use this feature when you need to control focus movement or when the cell has been set as a placeholder. By default, all cells can be selected. The following figure illustrates cell selection.
![Selecting Cells using Mouse](artwork/UserGuide_RowCell_Selectable.png)
![](images/hs-note.gif) |
It is not possible to restrict selection of rows. If you need to restrict row selection, you must restrict the selection of all the cells in the row. |
Using Code
The following code restricts the selection of 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).Selectable = False
|
[CS]
gcMultiRow1.Rows[0].Cells[1].Style.BackColor = Color.NavajoWhite;
gcMultiRow1.Rows[0].Cells[1].Selectable = false;
|
The following code allows the selection of the second cell in the first row. By default, all the cells in the grid can be selected.
[VB]
GcMultiRow1.Rows(0).Cells(1).Selectable = True
|
[CS]
gcMultiRow1.Rows[0].Cells[1].Selectable = true;
|
See Also