GrapeCity MultiRow Windows Forms Documentation
Restricting Cell Selection

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

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

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options