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

excel export button

1 Answer 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
dingen
Top achievements
Rank 1
dingen asked on 17 Feb 2010, 05:54 AM
Hi

I am using <CommandItemSettings ShowExportToExcelButton="true" /> and <MasterTableView CommandItemDisplay="Top" >to show my Excel Export Button on my grid. However the 'Add new record" icon shows up too? How can i make this invisible?

thanks
D

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Feb 2010, 06:59 AM
Hello Dingen,

The code snippet shown below will help you in hiding the "Add New Record" link and icon from grid.

CS:
 
    protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
        GridCommandItem cmdItem = (GridCommandItem)RadGrid1.MasterTableView.GetItems(GridItemType.CommandItem)[0]; 
        Button addButton = (Button)cmdItem.FindControl("AddNewRecordButton"); 
        addButton.Visible = false// Hide the icon 
        ((LinkButton)cmdItem.FindControl("InitInsertButton")).Visible = false;   // Hide the linkbutton 
    } 

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