Data Grid Rows and Cells Selection in C#.NET
The KetticGridView also allows the end users to select a single row or cell as well as multiple rows and cells at a time from the data that are shown in grid. UI designers can easily customize the GridView rows and cells selection manually for their C# Windows Forms application. The rows and cells selections allow users to perform selections like, select a single row, select multiple rows, select a single cell, and select multiple cells.
How to Select a Single Row in GridView
The GridView C#.NET component allows the users perform a single row selection in GridView. To achieve this, we need to change the value of the IsSelected property to True. The simple C# code snippet below shows how to enables the property.
It is also possible to achieve this by selecting a single grid row to make it current with the C# code below. The two approaches can add the grid rows to the GridView.SelectedRows collection.
How to Select Multiple Grid Rows
The GridView C#.NET component allows the users perform multiple rows selection in GridView. To achieve this, we need to change the value of the IsSelected property to True. The C# code below shows how to select multiple grid rows.
The above C# code will add the four grid rows to the SelectedRows collection in GridView. To access the instances of the grid rows selected, we can use the simple C# code as following.
How to Select a Single Grid Cell
The GridView C#.NET component applies the same approach of a single row selection to select cells in GridView. Firstly we need change the value of the IsSelected property to True. And then use the C# code below to select a single grid cell. The grid cell that has been chosen will be added to the GridView.SelectedCells collection.
How to Select Multiple Cells in GridView
To perform multiple cells selection in GridView, we need change the value of the IsSelected property of to True for all grid cells that will be selected. The C# code below shows how to enable the property to them.
The above C# code will add the four grid cells to the SelectedCells collection in GridView. To access the instances of the grid cells selected, we can use the simple C# code as following.
|
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 - RowGridView - CellsGridView - EditorsGridView - Context MenuGridView - Populating with DataGridView - Hierarchical GridData Binding AutomaticallyData Binding ProgrammaticallyXML Data SourceResize Child GridVieInfoOne to Many RelationsExpand RowsGridView - SelectionBasic SelectionMultiple SelectionProgrammatical Rows & Cells Selection GridView - ScrollingGridView - SortingSet ProgrammaticallySorting ExpressionsGridView - 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 |