Click here to Skip to main content
15,887,464 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have a textbox, which I'm using for searching, when i press a number or alphabet key the data is displayed on the gridview.
Now i want that when i press down arrow key in the textbox, the first row of the gridview got selected and the focus goes to the row so that i can use the a arrow keys to manuver up and down, which is already happening, the only problem is i have to click the mouse on the first row of the gridview.

Problem: i want, that when i press down arrow key in the textbox, the first row of the gridview got selected and the focus goes to the selected row

Thanks to all
Faiz
Posted
Comments
Zoltán Zörgő 11-Jun-12 10:48am    
Let's clarify: are you talking about ASP.NET WebForms and GridView OR WindowsForms and DataGridView?
Faiz_Khan 11-Jun-12 11:20am    
@Zoltan, its ASP.NET with C# WebApplication GridView
Faiz_Khan 11-Jun-12 11:19am    
@Zoltan, its ASP.NET with C# WebApplication GridView

1 solution

Hello,

For starters I am providing some links below. However you will need to modify the code given in the links as per your requirement. Hope it helps.

GridView Rows Navigation Using Arrow (Up/Down) Keys[^]

http://forums.asp.net/t/1193892.aspx/1[^]

http://forums.asp.net/t/1246686.aspx/1[^]

Regards,
Vani
 
Share this answer
 
v2
Comments
Faiz_Khan 12-Jun-12 15:06pm    
I dont want to click the gridview row with mouse so as to get the SelectedRow or SelectedIndex of the gridview, i just want to press the down arrow key focused on the textbox and the first row of the gridview got selected.
im using C#.net 3.5 web Application

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900