Hi All,
I have a requirement to export some data (which is completely different from radgrid's columns) into excel sheet when user clicks on radgrid's export to excel command button. I am able to create new worksheet with required data. How to remove default worksheet created by radgrid's columns ?
Thanks in advance
Gafoor.
9000999309
I have a requirement to export some data (which is completely different from radgrid's columns) into excel sheet when user clicks on radgrid's export to excel command button. I am able to create new worksheet with required data. How to remove default worksheet created by radgrid's columns ?
Thanks in advance
Gafoor.
9000999309
5 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 07 Jul 2014, 12:13 PM
Hi Gafoor,
I guess you want to hide the RadGrid and its Columns on export. Please try the following code snippet:
C#:
Thanks,
Shinu
I guess you want to hide the RadGrid and its Columns on export. Please try the following code snippet:
C#:
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e){ if (e.CommandName == RadGrid.ExportToExcelCommandName) { RadGrid1.Visible = false; foreach (GridColumn col in RadGrid1.Columns) { RadGrid1.MasterTableView.GetColumn(col.UniqueName).Visible = false; } }}Thanks,
Shinu
0
gafoor
Top achievements
Rank 1
answered on 08 Jul 2014, 06:04 AM
Hi Shinu,
Thank you very much for your response.
I already did the change you suggested to hide grid data in excel worksheet and grid data was not displaying in excel sheet. But the default worksheet remains exist in excel file. I want to remove/hide default worksheet as well. Please check attachment which contains excel screenshot.
Thank you again,
Gafoor.
Thank you very much for your response.
I already did the change you suggested to hide grid data in excel worksheet and grid data was not displaying in excel sheet. But the default worksheet remains exist in excel file. I want to remove/hide default worksheet as well. Please check attachment which contains excel screenshot.
Thank you again,
Gafoor.
0
Accepted
Hello Gafoor,
Could you please let me know which export format you are using? Basically a possible solution is to use the ExportInfrastructure and manually generate the export file. Please check out the following help article which elaborates more on this matter. Additionally you could examine the following code library as well.
Regards,
Kostadin
Telerik
Could you please let me know which export format you are using? Basically a possible solution is to use the ExportInfrastructure and manually generate the export file. Please check out the following help article which elaborates more on this matter. Additionally you could examine the following code library as well.
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.
0
gafoor
Top achievements
Rank 1
answered on 11 Jul 2014, 09:24 AM
Thank you Kostadin,
I referred the links which you provided to export data to excel.
Thanks again,
Gafoor.
I referred the links which you provided to export data to excel.
Thanks again,
Gafoor.
0
gafoor
Top achievements
Rank 1
answered on 11 Jul 2014, 09:27 AM
Hello Kostadin & Shinu,
Thanks for your support.
Regards
Gafoor.
Thanks for your support.
Regards
Gafoor.