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

access a label in the edititemtemplate

1 Answer 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Savyo
Top achievements
Rank 1
Savyo asked on 16 Oct 2012, 11:31 AM
Hi
     How can I access a label when it is in the edititemtemplate of a grid. Please help
Thanks
savyo

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 16 Oct 2012, 11:38 AM
Hi,

Try the following code to access the label in edititemtemplate.
C#:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
 if (e.Item is GridEditableItem && e.Item.IsInEditMode)
 {
    GridEditableItem item = (GridEditableItem)e.Item;
    Label lbl = (Label)item.FindControl("Label1");
  }
}

Thanks,
Princy.
Tags
Grid
Asked by
Savyo
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or