This is a migrated thread and some comments may be shown as answers.

[Solved] keyboard Arrow key event?

1 Answer 121 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Subhash Chandra
Top achievements
Rank 1
Subhash Chandra asked on 17 Jan 2011, 09:56 PM
Hi,
    In one of my requirement, I need to invoke a method when user presses down arrow key in a gridview cell.But I am not able to achieve this since arrow keys do not support keyup or key down event.

Please suggest me how do I achieve my goal.

Thanks,
Subhash

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 18 Jan 2011, 09:41 AM
Hello Subhash Subhash,

You may add a handler to the grid for the KeyDown event:

public MainPage()
        {
            InitializeComponent();
            this.clubsGrid.AddHandler(RadGridView.KeyDownEvent, new KeyEventHandler(OnKeyDown), true);
        }
 
        private void OnKeyDown(object sender, KeyEventArgs e)
        {
            if(e.Key == Key.Down)
            {          
                                    //Here you may implement the logic for calling the method you require.
            }
        }


All the best,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
Subhash Chandra
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or