I have a question that is pretty basic, but for me as a new developer it's hard to figure this out.
I will try to explain it as good as i can.
I have 3 different .aspx pages where i have different RadGrid tables. And in each of them i have made Excel export available. I have made aspx.cs code in each of them but now i'm trying to put everything in just on class. My problem is that i don't know how to make a method that can get the ExportSettings to work for each of the RadGrids.
This is my method i made in the new class and "gvShipmentList" ist the name on one of my RadGrids. What do i have to do so i can reach all of my RadGrids through this method?
------------------------------------------
public static void ExportExcelOnItemCommand(object sender, GridCommandEventArgs e) {
if (e.CommandName == RadGrid.ExportToExcelCommandName)
{
gvShipmentList.ExportSettings.FileName = "ShipmentList";
gvShipmentList.ExportSettings.ExportOnlyData = true;
gvShipmentList.ExportSettings.IgnorePaging = true;
gvShipmentList.ExportSettings.OpenInNewWindow = true;
gvShipmentList.GridLines = GridLines.Both;
foreach (GridColumn column in gvShipmentList.MasterTableView.Columns)
{
column.Visible = column.Display;
}
gvShipmentList.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;
gvShipmentList.MasterTableView.ExportToExcel();
}
}
-------------------------------
I hope someone can help me, and please, if i haven't given enough information then tell me so i can provide you with more. Like i said, i'm very new at this and trying to learn. But this was too hard.
Kind regards Tim