Hi ,
I am using telerik RadGrid in my application. I want to export the RadGrid Detail Table's and Parent Table's Footer Row in the excel sheet. I have used the ExcelMLExportRowCreated event to export the footer records which contains the following code :
if (e.Worksheet.Table.Rows.Count == radGrid.Items.Count + 2)
{
RowElement row = new RowElement();
GridFooterItem footer =radGrid.MasterTableView.GetItems(GridItemType.Footer)[0] as GridFooterItem;
foreach (GridColumn column in radGrid.MasterTableView.Columns)
{
CellElement cell = new CellElement();
String cellText = footer[column.UniqueName].Text;
cell.Data.DataItem = cellText == " " ? "" : cellText;
row.Cells.Add(cell);
}
e.Worksheet.Table.Rows.Add(row);
}
This works fine for the parent table as we know exact row number for the parent table, But in case of detail table we are not able to determine. Please help me in this.
Thanks,
I am using telerik RadGrid in my application. I want to export the RadGrid Detail Table's and Parent Table's Footer Row in the excel sheet. I have used the ExcelMLExportRowCreated event to export the footer records which contains the following code :
if (e.Worksheet.Table.Rows.Count == radGrid.Items.Count + 2)
{
RowElement row = new RowElement();
GridFooterItem footer =radGrid.MasterTableView.GetItems(GridItemType.Footer)[0] as GridFooterItem;
foreach (GridColumn column in radGrid.MasterTableView.Columns)
{
CellElement cell = new CellElement();
String cellText = footer[column.UniqueName].Text;
cell.Data.DataItem = cellText == " " ? "" : cellText;
row.Cells.Add(cell);
}
e.Worksheet.Table.Rows.Add(row);
}
This works fine for the parent table as we know exact row number for the parent table, But in case of detail table we are not able to determine. Please help me in this.
Thanks,