We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Mutliselect datagrid

I have a GridDataBoundGrid that I'm trying to use as a multiselect control. Users will select several rows and then perform an action based on the selections. When focus leaves the grid, all the selections are removed and focus is put on the first row. How do I prevent my selections from clearing when leaving the grid?

Todd

1 Reply

HA haneefm Syncfusion Team March 28, 2007 07:08 PM UTC

Hi Todd,

One way you can do this by handling the Model.Selectionchanging event of the grid and set e.Cancel to true for keeping the selection in a grid. Here is a code snippet.

this.grid.Model.SelectionChanging += new GridSelectionChangingEventHandler(Model_SelectionChanging);

void Model_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
{
e.Cancel = !this.grid.Focused;
}

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon