Hi..
i have a column with hyperlink. i am exporting the grid in excel file.
i have set "ExportOnlyData = true" so it will not display data with hyperlink.
so to overcome from the problme i created on more column with same data without hyperlink.
initially i am setting it visible=false and while exporting i am setting it visible = true.
but it is not displaying the column in exported excel file.
code on export button click :
i have used custom paging in the grid.
this solution works fine with one gird in which custom paging is not used.
Thanks,
i have a column with hyperlink. i am exporting the grid in excel file.
i have set "ExportOnlyData = true" so it will not display data with hyperlink.
so to overcome from the problme i created on more column with same data without hyperlink.
initially i am setting it visible=false and while exporting i am setting it visible = true.
but it is not displaying the column in exported excel file.
code on export button click :
| protected void btnExport_Click(object sender, System.EventArgs e) | |
| { | |
| dg.MasterTableView.Columns.FindByUniqueName("Delete").Visible = false; | |
| dg.Columns.FindByUniqueName("clName").Visible = false; | |
| dg.Columns.FindByUniqueName("clNamePrint").Visible = true; | |
| foreach (GridItem commandItem in this.dg.MasterTableView.GetItems(GridItemType.FilteringItem)) | |
| { | |
| commandItem.Visible = false; | |
| } | |
| dg.ExportSettings.FileName = Page.Title; | |
| dg.ExportSettings.OpenInNewWindow = true; | |
| dg.ExportSettings.ExportOnlyData = true; | |
| dg.MasterTableView.ExportToExcel(); | |
| } |
i have used custom paging in the grid.
this solution works fine with one gird in which custom paging is not used.
Thanks,