Determine Selected Row when keyboard arrows are used

I am using a DataGrid and need to know what event is fired when I move from cell to cell by using the keyboard directional (arrows) keys. Then I need to know what row the cursor is in so I can use that row information to search a database table and provide additional information.

Thanks

1 Reply

HA haneefm Syncfusion Team July 31, 2007 07:25 PM UTC

Hi Greg,

What event is fired when I move from cell to cell by using the keyboard directional (arrows) keys?.
>>>>>>>>>>>>>
You can use the CurrentCellKeyDown event to handle the arrow keys. To detect the cell moving, you can handle the CurrentCellMoving/CurrentCellMoved event of the grid. Also you can use the CurrencyManager.Current property to get the selected(current row) object from the grid. Below is a code.

CurrencyManager cm = this.BindingContext[this.gridDataBoundGrid1.DataSource] as CurrencyManager;
Console.WriteLine("For Current Item >>>>>>>" + cm.Current);

Best regards,
Haneef

Loader.
Up arrow icon