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

Reference Control in Row

1 Answer 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rhys
Top achievements
Rank 1
Rhys asked on 17 Aug 2008, 05:40 AM
Does anyone have a code snippet for referencing a control in a row?

protected

void RadGrid1_InsertCommand1(object source, Telerik.Web.UI.GridCommandEventArgs e)

{

//need code to refernece a web control in the edit form

}

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 18 Aug 2008, 04:22 AM
Hi Rhys,

Try the following code snippet access control from the edit form.

CS:
 protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode)) 
        { 
            GridEditFormItem edititem = (GridEditFormItem)e.Item; 
            TextBox txtbx = (TextBox)edititem["FirstName"].Controls[0]; 
        } 
  
    } 


Thanks
Shinu.
Tags
Grid
Asked by
Rhys
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or