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

Rad DropDown keyboard access

3 Answers 55 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Syed Danish
Top achievements
Rank 1
Syed Danish asked on 27 Apr 2010, 12:39 PM
Hi,

We made a custom control out of the Rad DropDown Button where the Grid is the Drop Down pop up. I this control we need to have the Drop Down access through the 'Up' and 'Down' keys. We are handling this with the key press event. This works perfectly fine with the up arrow and with down arrow the Drop Down Button pop up opens, instead I need the selected value of drop down to change with out opening the pop up. Is there a way to stop the pop up from opening when the down arrow is pressed. The sample code is being attached.

  this.KeyDown += (o, e) => 
            { 
                switch (e.Key) 
                { 
                    case Key.Down: 
                        try 
                        { 
                            this.grid.SelectedIndex++; 
                        } 
                        catch (Exception) 
                        { 
                            this.grid.SelectedIndex = 1; 
                        } 
                        break
                    case Key.Up: 
                        try 
                        { 
                            this.grid.SelectedIndex--; 
                        } 
                        catch (Exception) 
                        { 
                            this.grid.SelectedIndex = 1; 
                        } 
                        break
                } 
            }; 

Will be greatfull if someone helps me out.

3 Answers, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 30 Apr 2010, 10:22 AM
Hi Syed,

The easiest way is to inherit from RadDropDownButton and do nothing in the OnKeyDown override. I've created a simple project that gives one possible solution to your scenario. Have a look at it and let me know if it helps.

Sincerely yours,
Kiril Stanoev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Syed Danish
Top achievements
Rank 1
answered on 06 May 2010, 12:49 PM
Hi Kiril,

Thanks for the solution it worked.

Thanks & Regards,
Syed Danish
0
Ivan
Telerik team
answered on 06 May 2010, 04:10 PM
Hello Syed,

We are happy to hear everything is OK at your side.

Of course if you have other questions please drop us a line.

Best wishes,
Ivan
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Buttons
Asked by
Syed Danish
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Syed Danish
Top achievements
Rank 1
Ivan
Telerik team
Share this question
or