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

How to hide the edit column before exporting to excel

3 Answers 258 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul Stack
Top achievements
Rank 1
Paul Stack asked on 15 Oct 2008, 10:52 AM
hi

i have used a rad grid with the edit column user control. i have also got a ExportToExcel functionality on the page. when the users fires the edit command a graph shows up on the page but then this graph does not go away for the export to excel functionality. i have tried a few ways of hiding the form but to no avail

protected void btnExportToExcel_Click(object sender, EventArgs e)
{
    rgMetrics.MasterTableView.EditFormSettings.EditColumn.Visible = false;
    rgMetrics.MasterTableView.ExportToExcel();
}

this does not work - is there anything you can advise me on?

thnaks

paul

3 Answers, 1 is accepted

Sort by
0
Paul Stack
Top achievements
Rank 1
answered on 15 Oct 2008, 11:11 AM
i have solved this problem -

thanks

paul


0
jfkrueger
Top achievements
Rank 1
answered on 10 Feb 2009, 07:50 PM
how did you solve your problem?
0
Shinu
Top achievements
Rank 2
answered on 11 Feb 2009, 03:55 AM
Hi Joe,


You can access a Grid column using its columnUniqueName and hide it using its Visible property in the click event of the Export button

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

CS:
 private void Button1_Click(object sender, System.EventArgs e) 
   
  // access the EditColumn using its columnUniqueName  
  RadGrid1.MasterTableView.Columns.FindByUniqueName( "EditColumn").Visible = false
  
  RadGrid1.ExportSettings.OpenInNewWindow = true
  RadGrid1.MasterTableView.ExportToExcel(); 
}  

Exporting tips and tricks



Thanks
Shinu




Tags
Grid
Asked by
Paul Stack
Top achievements
Rank 1
Answers by
Paul Stack
Top achievements
Rank 1
jfkrueger
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or