Semi Transparent Grid Selection
Grid row selection is a very important feature that determines how user-friendly is the component. The most frequent selection implementation in existing grids is inversion of background cell colors or painting cells with a predefined calor. It is the easiest implementation, however in this case the end user may have problems understanding the information. With such approach important information can be obscured and become unavailable for selected rows. In .Net Grid the selection system has been revamped to make it most user-friendly, to provide the most convenient API and to ensure component performance. When .Net Grid selects rows, it mixes selection colors with row background color and displays a frame around selection. The frame is not displayed between to adjacent selected rows. Such approach is the most intuitive for end user and preserves all information displayed in the grid.
All complexity of semi-transparent selection and frame control are implemented in .Net Grid, and the programmer gets a simple and convenient API to control selection.
row.Selected = true;
foreach (Row selectedRow in grid.Selection)
An additional lasso selection feature has been implemented to enable more user-friendly selection method. To initiate this selection mode you have to click left mouse button with the cursor over rows in row selector area or over an empty area beyond the last visible row of the grid. When the cursor is moved with left mouse button pressed, a rectangular area appears. All rows in this area become selected. Lasso selection works only when multiple row selection is on.
The grid may have multiple selected rows, but only one focused row, i.e. selection is a property of the row, while focus is a property of the grid. The grid provides standard user-friendly tools to control selection and focus. Rows are selected by left-clicking grid cells, area above row selector or location above the area to the right of the last visible column. Clicking a row selects it and puts it in focus. Clicking a row with different keys pressed may have various effects. The most frequent key shortcuts for the grid are listed below.
Back to .Net Grid Features
|Key shortcut ||Description |
|Left click ||Focusing and selecting a row |
|Ctrl + left click ||Focusing a row, inverting selection |
|Shift + left click ||Focusing a row, selection of all rows between the previously focused row and the new focused row |
|Escape ||Removing selection and focus |
|Ctrl + A ||Selection of all content |
|Moving the cursor with left mouse button pressed ||Lasso selection - selection of content in a rectangular area |
determined by beginning of lasso operation and current cursor position.
|Shift + Moving the cursor with left mouse button pressed ||Lasso selection - selection of content in a rectangular area |
determined by the beginning of lasso operation and current cursor
position. Previous selection is preserved.
|Key Up/Down ||Focus move. Selects the newly focused row. |
|Key PageUp /PageDown ||Selects and focuses a row that is one page above or below the previously focused row. |
|Home/End ||Selects first or last row in the grid. |
|Shift + Key Up / Down / PageUp / PageDown / Home / End ||Focuses a new row and selects all rows between the last focused row and the new focus. |
|Ctrl + Key Up / Down / PageUp / PageDown / Home / End ||Just moves the focus without changing selection. |
|Key right ||Moving to the last child, or if none is available, to the next row selecting it. |
|Key left ||Moving to the first child, or if none is available, to the previous row selecting it. |