Dear Telerik,
I am having the RadGrid which is also having child details showing through hierarchical method of grid. I have the following doubts to Export the grid into Excel.
* Need to export the parent grid and hierarchical or child details only if it is expanded.
* I would like to show only the datas means columns and rows of parent and child rather than displaying the items like filter,expand/collapse, add/referesh/edit buttons etc.
* I used the follwing block of code to export excel. But it seems i am not not getting the proper positin of the columns means columns showing right side and rows are showing left side of the excel sheet. It is also exporting all of the child rows from the grid eventhough i am not expanding all of them.
Hope my above code and scenario is understandable.If so please let me know the possibilites.
-Thanks in Advance
I am having the RadGrid which is also having child details showing through hierarchical method of grid. I have the following doubts to Export the grid into Excel.
* Need to export the parent grid and hierarchical or child details only if it is expanded.
* I would like to show only the datas means columns and rows of parent and child rather than displaying the items like filter,expand/collapse, add/referesh/edit buttons etc.
* I used the follwing block of code to export excel. But it seems i am not not getting the proper positin of the columns means columns showing right side and rows are showing left side of the excel sheet. It is also exporting all of the child rows from the grid eventhough i am not expanding all of them.
private void ConfigureExcelExport()
{
//ExportExcel configuration settings
//rgPostingBill.MasterTableView.Caption = "PostingNotice Billing Report";
RadGrid1.ExportSettings.FileName = "PostingNotice";
RadGrid1.ExportSettings.IgnorePaging = true;
//RadGrid1.ExportSettings.HideStructureColumns = true;
RadGrid1.MasterTableView.HierarchyDefaultExpanded = true;
RadGrid1.ExportSettings.ExportOnlyData = true;
RadGrid1.ExportSettings.OpenInNewWindow = true;
}
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
if (isExcelExport)
{
if (e.Item is GridNoRecordsItem)
e.Item.Visible = false;
if (e.Item is GridCommandItem)
e.Item.Visible = false;
//if (e.Item is GridNestedViewItem)
// e.Item.Cells[0].Visible = false;
//if (e.Item is GridDataItem)
//{
// GridDataItem item = e.Item as GridDataItem;
// foreach (GridColumn col in e.Item.OwnerTableView.RenderColumns)
// if (!(col is GridBoundColumn))
// item[col.UniqueName].Visible = false;
//}
}
}
Hope my above code and scenario is understandable.If so please let me know the possibilites.
-Thanks in Advance