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

Hide GridEditCommanColumn

1 Answer 22 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Erin
Top achievements
Rank 1
Erin asked on 19 Dec 2013, 01:56 PM
Hi.
I have a GridEditCommanColumn , i want to hide this when the grid goes to insert mode?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Dec 2013, 02:01 PM
Hi Erin,

Please try the following code snippet:

ASPX:
<telerik:GridEditCommandColumn UniqueName="EditCommandColumnUniqueName">
</telerik:GridEditCommandColumn>

C#:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
    if (e.Item is GridDataInsertItem && e.Item.OwnerTableView.IsItemInserted)
    {
       foreach (GridDataItem dataItem in RadGrid1.MasterTableView.Items)
        {
            ((LinkButton)dataItem["EditCommandColumnUniqueName"].Controls[0]).Visible = false;
        }
    }    
}

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