Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to set focus textbox in gridview row at runtime in asp.net
Posted

C#
Dim txt As TextBox = DirectCast(timegrid.Rows(0).FindControl("your_textbox_id"), TextBox)
SetFocus(txt)
 
Share this answer
 
Comments
Member 10433948 4-Dec-13 7:36am    
thank for ur solutions
Thanks7872 4-Dec-13 7:37am    
You are welcome. You can accept the solutions that helped you.
C#
 foreach (GridViewRow gvr in GridView2.Rows)
        {
          TextBox txt1 = (TextBox)gvr.FindControl("txt2");
          txt1 .Focus();
}



Best of luck.
 
Share this answer
 
Comments
Member 10433948 4-Dec-13 7:35am    
thank for the ur solution
C@dER@j 6-Dec-13 1:13am    
If it realy help u please vote it.

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