$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
DataGridView .NET WinForms Control
Rows and cells selection in C# from data grid in Windows Forms applications
Home > WinForms UI Controls > User Manual > Data Grid Multiple Selection in C#

Select Multiple Items from Data Grid in C#.NET

The Kettic DataGridView provides the support of multiple selection for end users to select more than one items at a time from the data that are shown in grid. However, the functionality doesn’t enable by default setting. To enable this feature, GridView UI designers need to change the value of the MultipleSelect property to true for their C# Windows Forms application.

How to Select Multiple Rows in C#

To perform the multiple rows selection, we need enable the MultipleSelect property first, and then set the SelectMode to GridViewSelectMode.SelectFullRows. The C# code below shows how to achieve this.

ketticGridView1.MultipleSelect = true;
ketticGridView1.SelectMode = GridViewSelectMode.SelectFullRows;
After enabling the multiple rows selection functionality to GridView, we can perform the multiple rows selection through different approaches as following,
  • Choose the complete grid rows by holding Ctrl plus A keys
  • Choose a part of the grid rows by clicking the grid rows while press the Ctrl key
  • Select a group or a block of grid rows by choosing the first row, then pressing the Shift key, and finally selecting the last grid row
  • The grid rows that have been chosen are added to the GridView.SelectedRows collection

How to Select Multiple Cells in C#

To select multiple cells from data grid, we need enable the MultipleSelect property to DataGrid. And then set the SelectMode to GridViewSelectMode.SelectCells. The C# code below shows how to achieve the setting.

ketticGridView1.MultipleSelect = true;
ketticGridView1.SelectMode = GridViewSelectMode.SelectCells;
After enabling the multiple cells selection functionality to GridView, we can perform the multiple cells selection through different approaches as following,
  • Choose the complete grid cells by holding Ctrl plus A keys
  • Choose a some of the grid cells by clicking the grid cells while press the Ctrl key
  • Select a group or a block of grid cells by choosing the first cell, then pressing the Shift key, and finally selecting the last grid cell
  • The grid rows that have been chosen are added to the GridView.SelectedCells collection

How to Perform Rectangle Selection in C#

The Kettic DataGridView allows users easily make a rectangle rows or cells selection. To achieve this, we need enable the MultipleSelect property, then hold the left mouse button, and finally move the mouse to select rows and cells in a rectangle.
When we do not need display the TranslucentRectangle in the process of performing multiple selection, we need disable the DisplayTranslucentSelectRectangle property. The C# code below shows how to achieve this.

ketticGridView1.TableElement.DisplayTranslucentSelectRectangle = false;
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