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

Selection works with mouse but not keyboard

Hi,

I am using a GridDataBoundGrid control. If the user clicks a row I can use Selections.GetSelectedRange(...) to get the row. If the user uses the up and down cursor keys to change rows, the Selections.GetSelectedRange(...) method returns nothing.

How can I allow both clicking on a row and cursoring through rows to affect the selection?

Thanks

1 Reply

JS Jeba S Syncfusion Team August 20, 2007 04:28 AM UTC

Hi Icd,

Thank you for your details.

You can handle the SelectionChanged event and get the selected row using mouse and keyboard.


void Model_SelectionChanged(object sender, Syncfusion.Windows.Forms.Grid.GridSelectionChangedEventArgs e)
{
GridRangeInfoList rangelist;
this.gridDataBoundGrid1.Selections.GetSelectedRanges(out rangelist, true);
foreach (GridRangeInfo range in rangelist)
{
Console.WriteLine(range.ToString());
}
}


Please refer the sample which implements the above said feature.
http://websamples.syncfusion.com/samples/Grid.Windows/F67457/main.htm

Kindly let us know if you need any further assistance.

Thank you for using Syncfusion Products.

Best Regards,
Jeba.

Loader.
Live Chat Icon For mobile
Up arrow icon