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

Select Multiple Cells including the Header

I have GridControl and I would like to allow the possibility to select multiple cells.
It does work for all the cells beside the Header,
I can select every cells but not the Header.
How I can enabled this feature?

1 Reply

AA Arulraj A Syncfusion Team May 28, 2010 03:26 PM UTC

Hi Riccardo,

Thanks for your interest in Syncfusion Products.

By default, when the column header cell is selected, it will select that entire column. If you would like to select only the column header cell while clicking on it, you can handle the SelectionChanging event and get the first cell value by GetFirstCell() method and reset the values of that range. The below code explains the same.

int top, left ;
void gridControl1_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
{
if (e.ClickRange.IsCols)
{
Clipboard.Clear();
e.Range.GetFirstCell(out top, out left);
e.Range = GridRangeInfo.Cell(top, left);
}
}

Please let me know if you have any further concerns.

Regards,
Arulraj.A

Loader.
Live Chat Icon For mobile
Up arrow icon