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

select row in gridview

2 Answers 91 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chirag
Top achievements
Rank 1
Chirag asked on 05 Sep 2011, 08:16 AM
hi to all 
i have one Telerik Gridview  and textbox in my form 
when i press any key in textbox, base on textbox's text data will filter and rebind it in Gridview 
now i want to do one more thing when i press down arrow  of keyboard in textbox then cursor will set to on grid-view's first item and display as selected row (change selected item color) 
when i press down arrow that time i am select first item of grid but item color will not change (like when click any item of grid with mouse) 

please help me it's urgent 

2 Answers, 1 is accepted

Sort by
0
Chirag
Top achievements
Rank 1
answered on 06 Sep 2011, 10:09 AM
no one has answer of this post it's a strange ?
0
Dimitrina
Telerik team
answered on 06 Sep 2011, 03:39 PM
Hello Chirag,

 Do you apply some custom logic when you press the down arrow key of the keyboard inside the text box?

In order to get the row highlighted, the SelectedItem property of the GridView should be set. So when the grid gets the focus you just set the SelectedItem to be CurrentItem(the item that contains the currently focused cell):

Copy Code
this.clubsGrid.SelectedItem = this.clubsGrid.CurrentItem;

I hope that this helps.

Regards,
Didie
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
GridView
Asked by
Chirag
Top achievements
Rank 1
Answers by
Chirag
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or