Hi everybody,
I have a FormView with UserControls inside. I want to be able to set focus to the FirstControl in the FormView (BTW, this control in the ReadOnly mode).
I tried
TextBox txt = currentForm.Row.FindControl("txtFirstName") as TextBox;
if (txt != null)
txt.Focus();
else
currentForm.Row.Focus();
txtFirstName is a first control in the General User Info user control.
I only got the else part executed.
Any ideas how can I set focus to the first control?
Thanks a lot in advance.
If it's not broken, fix it until it is.
My Blog