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.
Unfortunately, activation email could not send to your email. Please try again.

Determine Selected Row when keyboard arrows are used

Thread ID:

Created:

Updated:

Platform:

Replies:

66594 Jul 31,2007 09:01 AM Jul 31,2007 03:25 PM Windows Forms 1
loading
Tags: GridControl
Greg Goodall
Asked On July 31, 2007 09:01 AM

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

haneefm [Syncfusion]
Replied On July 31, 2007 03:25 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;