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 Design
WinForms UI Controls