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

Web user control radtextbox

1 Answer 111 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tina
Top achievements
Rank 1
Tina asked on 04 Nov 2011, 02:00 AM
I have a radgrid web usercontrol edit form.how can i access the radtextbox in usercontrol and make it readonly?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Nov 2011, 04:00 AM
Hello Tina,

Try the following code snippet.
C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
 if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
 {
   GridEditFormItem item = (GridEditFormItem)e.Item;
   UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
   RadTextBox txt = (RadTextBox)userControl.FindControl("RadTextBox1");
   txt.ReadOnly = true;
 }
}
Tags
Grid
Asked by
Tina
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or