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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid Row Navigation

Thread ID:

Created:

Updated:

Platform:

Replies:

95243 Jun 28,2010 05:53 PM UTC Jul 14,2010 01:01 PM UTC WPF 1
loading
Tags: GridControl
Kiran Dwarakapuram
Asked On June 28, 2010 05:53 PM UTC

Hi,

I am using GridDataControl as a popup (showing the matches for the criteria entered in a Textbox). I want to handle UP, DOWN, PAGEUP, AGEDOWN, HOME and END keys in the grid. Since these key input events are part of Textbox, I have a public method that handles this:

public bool HandleKey( Key key, ModifierKeys modifiers )
{
switch (key)
{
case Key.Up:
{
ICollectionViewAdv collectionViewAdv = resultsGrid.Model.View;
if (collectionViewAdv.CurrentPosition > 0) collectionViewAdv.MoveCurrentToPrevious();
break;
}
case Key.Down:
{
ICollectionViewAdv collectionViewAdv = resultsGrid.Model.View;
if (collectionViewAdv.CurrentPosition < collectionViewAdv.Records.Count - 1)
{
collectionViewAdv.MoveCurrentToNext();
}
break;
}
case Key.Home:
{
resultsGrid.Model.View.MoveCurrentToFirst();
break;
}
case Key.End:
{
resultsGrid.Model.View.MoveCurrentToLast();
break;
}
case Key.Enter:
onSelectRow();
break;
default:
return false;
}
return true;
}

I don't know how to handle PAGEUP and PAGEDOWN.
Is this the right way of doing? Can you tell me how to handle PAGEUP and PAGEDOWN?
Please let me know if you have any quetions. Thanks.

Regards
Kiran

Muthulakshmi N [Syncfusion]
Replied On July 14, 2010 01:01 PM UTC

Hi Kiran,

You can handle the Page Up and PageDown for GridData Control as follows.

case Key.PageUp:
{
this.dataGrid.Model.CurrencyManager.CurrentCell.PageUp();
this.dataGrid.Model.CurrencyManager.CurrentCell.ScrollInView();
e.Handled = true;
break;
}
case Key.PageDown:
{
this.dataGrid.Model.CurrencyManager.CurrentCell.PageDown();
this.dataGrid.Model.CurrencyManager.CurrentCell.ScrollInView();
e.Handled = true;
break;
}

Please let us know if you need any more information.

Thanks,
Muthulakshmi

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.

Warning Icon 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.Close Icon

;