Hi Kumar,
You can do this thing in two ways:
1) When you have set the datasource of the grid and executed GridName.DataBind(). Then there is event of the grid as ItemDataBound. You need to map the e object of the method agrument to the cell position where your textbox is. Then declare a textbox object and cast it with the object position found as FindControl like this:
TextBox txtTemp = new TextBox();
txtTemp = (TextBox)e.Items.Cells(0).FindControl("txtName");
soon you have that object casted in the txtTemp then set the focus in it.
If (txtTemp != null)
{ txtTemp.Focus(); }
2) If you have already populated the grid, then loop through the grid and retrieve the row object of the looped row. Find the mapped position as above and set the focus.
Regards,
Moiz
Enter your message below
Sign in or Join us (it's free).