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

Export from grid with EditMode Problem

1 Answer 24 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Swapnil
Top achievements
Rank 1
Swapnil asked on 17 Sep 2013, 07:54 AM
Hi,
i am having a grid in which i used editmode and automatic insert mode but problem is when i am exporting that data to pdf or any other format the edit and delete keyword coming with data
i have attached the images for reference
how can i avoid this
Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 18 Sep 2013, 05:35 AM
Hi Swapnil,

Please try the following code snippet to hide the Edit and Delete column on exporting.

ASPX:
<telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditColumn">
   </telerik:GridEditCommandColumn>               
<telerik:GridButtonColumn CommandName="Delete" ButtonType="ImageButton" UniqueName="DeleteColumn">
   </telerik:GridButtonColumn>

C#:
protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
   {
       if (e.CommandName == RadGrid.ExportToPdfCommandName)
       {
           RadGrid1.MasterTableView.GetColumn("EditColumn").Visible = false;
           RadGrid1.MasterTableView.GetColumn("DeleteColumn").Visible = false;
       }
   }

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