Skip to content

Commit 7231430

Browse files
Commit the changes.
1 parent 35b1359 commit 7231430

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
In [WinForms DataGrid](https://www.syncfusion.com/winforms-ui-controls/datagrid) (SfDataGrid), limiting selection to a maximum of two can be achieved by handling the [SelectionChanging](https://help.syncfusion.com/cr/windowsforms/Syncfusion.WinForms.DataGrid.SfDataGrid.html#Syncfusion_WinForms_DataGrid_SfDataGrid_SelectionChanging) event. Within this event, logic can be applied to evaluate the counts of [SelectedItems](https://help.syncfusion.com/cr/windowsforms/Syncfusion.WinForms.DataGrid.SfDataGrid.html#Syncfusion_WinForms_DataGrid_SfDataGrid_SelectedItems), **RemovedItems**, and **AddedItems**. If the total number of selected rows exceeds two, the selection process can be cancelled by setting **e.cancel** to **true**.
44

55
```csharp
6+
//Event subscription
7+
sfDataGrid1.SelectionChanging += OnSelectionChanging;
8+
9+
//Event customization
610
private void OnSelectionChanging(object sender, SelectionChangingEventArgs e)
711
{
812
var dataGrid = (sender as SfDataGrid);

0 commit comments

Comments
 (0)