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

hide the label in edit item template

1 Answer 126 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, 12:31 PM
Hi
     How do I hide the label in edit item template on certain condition.
Savyo

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Oct 2012, 12:36 PM
Hi,

Please try the following code snippet.

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");
    if(your condition)
    {
       lbl.Visible = false;
    }
  }
}

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