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

Hide CommandItemTemplate

1 Answer 316 Views
Grid
This is a migrated thread and some comments may be shown as answers.
RB
Top achievements
Rank 1
RB asked on 18 Nov 2014, 09:06 PM
I have a radgrid with Add, delete and refresh buttons in the CommandItemTemplate. On click of Add, I want to hide the template. How can I achieve this?

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 21 Nov 2014, 09:51 AM
Hello Ruchi,

You can hide the CommandItemTemplate by setting CommandItemDisplay to None on an add button click. For this purpose you need to hook OnItemCommand event handler and check whether the fired command is InitInsert. Please check out the following code snippet.
protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.InitInsertCommandName)
    {
        RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
    }
}

Regards,
Kostadin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
RB
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or