Select Gird Rows and Set Current Grid Row in C#
.NET DataGridView Component allows users of the GridView WinForms control to select a row in data grid for C# Windows Forms applications. A data row in the grid stands for a record that is from the Data Source and the Kettic DataGridView Control provides the IsSelected property for users of the C# GridView component to select a specified data row to the GridView in C#.NET Windows Forms applications.
Select Grid Row in C# WinForms
To select a data row in grid to the DataGridView control in C# Windows Forms application, we need to use the IsSelected property, which is provided to perform the data row selection in grid in C# Windows Forms projects. The simple C# code snippet below demonstrates how to enable the grid row selection to C# DataGridView for your Windows Forms application.
C# code for selecting a row in grid
Clear Selected Data Rows to C# GridView
The Kettic DataGridView control will include all currently selected grid rows into the SelectedRows collection. When we clear the SelectedRows collection of the GridView control, and then update the clearing message information to Kettic DataGridView control, all the selected data rows in grid will be deselected. The simple C# code snippet below demonstrates how to deselect the grid rows to DataGridView for C# Windows Forms application.
C# code for deselecting the selected rows in grid
Set Current Grid Rows in C#
The Kettic DataGridView control includes the IsCurrent property for users of the GridView component to set which data row in grid is to be the current row. However, when the value of the IsCurrent property is null, there can be only one current row or no current row to the DataGridView control for C# Windows Forms application.
The DataGridView control visualizes the current grid row in most themes in the similar way of visualizing the selected grid rows, although the selected grid rows property and the current grid row property would be independent of each other technically. The IsCurrent property provides the support of keyboard. The simple C# code snippet below shows how to clear the current grid rows to DataGridView for C# Windows Forms application.
C# code for removing the current row in grid to GridView
|
UI Controlsfor Windows Forms .NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI DesignWinForms UI Controls WinForms Buttons UI Control WinForms Calendar UI ControlWinForms Carousel UI ControlWinForms Chart UI ControlWinForms Clock UI ControlCommandBar UI ControlWinForms Dock UI ControlDesktop Alert UI ControlDropDown List UI ControlWinForms Editor UI ControlForms and Dialogs UI ControlWinForms GridView UI ControlGridView - Get Started in C#GridView - PropertiesGridView - ColumnGridView - RowRow - IterateRow - InsertRow - RemoveRow - Rows & Child RowsRow - Format RowsRow - Pinned RowsRow - Select RowsRow - Conditional Format RowsRow - Selection RectangleRow - Summary RowsRow - Painting RowsGridView - CellsGridView - EditorsGridView - Context MenuGridView - Populating with DataGridView - Hierarchical GridGridView - SelectionGridView - ScrollingGridView - SortingGridView - GroupingGridView - FilteringGridView - Expression EditorInsert/ Update/ Delete RecordsGridView - View DefinitionGridView - Exporting DataStyling and AppearanceGridView - LocalizationSave and Load LayoutGridView - Print SupportWinForms ListView UI ControlWinForms Menu UI ControlWinForms ComboBox UI ControlWinForms PageView UI ControlPanels and Labels UI ControlWinForms Panorama UI ControlWinForms PDFViewer UI ControlWinForms Property Grid UI ControlWinForms Ribbon UI ControlWinForms PivotGrid UI ControlWinForms RichTextBox UI ControlWinForms Rotator UI ControlWinForms Scheduler UI ControlWinForms Shortcuts UI ControlWinForms SpellChecker UI ControlWinForms Track & Status UI ControlWinForms TreeView UI ControlWinForms Wizard UI ControlWinForms Test UI ControlWinForms Theme UI Control |