Hi,
I'm having some issue with export selected columns and I hope you can help me with it.
On my page I have a RadGrid_Parent that uses an sqldatasource with autogeneratecolumns='false'
inside the RadGrid_Parent I'm making use of the NestedViewTemplate to expand or collapse the selected row.
When the RadGrid_Parent expands it opens another RadGrid_Child AutoGeneratedColumns='true' EnableHeaderContextMenu='true' that uses needdatasource advanced databinding.
The problem I'm having is when i try to export the nestedview RadGrid_Child that uses the advanced data binding it exports all the columns it ignores any column I hide using the EnableHeaderContextMenu
I also tried to make the columns display and visible false in the ItemCommand section but it still picks up columns as display all.
Example of the ItemCommand code as mentioned in sentence above.
if (e.CommandName == Telerik.Web.UI.RadGrid.ExportToExcelCommandName ||
e.CommandName == Telerik.Web.UI.RadGrid.ExportToWordCommandName ||
e.CommandName == Telerik.Web.UI.RadGrid.ExportToCsvCommandName ||
e.CommandName == Telerik.Web.UI.RadGrid.ExportToPdfCommandName)
{
foreach (GridColumn col in RadGridChild.MasterTableView.AutoGeneratedColumns)
{
if (!col.Display)
{
col.Display = false;
col.Visible = false;
}
}
}
Any help would be greatly appreciated.
Kind Regards
I'm having some issue with export selected columns and I hope you can help me with it.
On my page I have a RadGrid_Parent that uses an sqldatasource with autogeneratecolumns='false'
inside the RadGrid_Parent I'm making use of the NestedViewTemplate to expand or collapse the selected row.
When the RadGrid_Parent expands it opens another RadGrid_Child AutoGeneratedColumns='true' EnableHeaderContextMenu='true' that uses needdatasource advanced databinding.
The problem I'm having is when i try to export the nestedview RadGrid_Child that uses the advanced data binding it exports all the columns it ignores any column I hide using the EnableHeaderContextMenu
I also tried to make the columns display and visible false in the ItemCommand section but it still picks up columns as display all.
Example of the ItemCommand code as mentioned in sentence above.
if (e.CommandName == Telerik.Web.UI.RadGrid.ExportToExcelCommandName ||
e.CommandName == Telerik.Web.UI.RadGrid.ExportToWordCommandName ||
e.CommandName == Telerik.Web.UI.RadGrid.ExportToCsvCommandName ||
e.CommandName == Telerik.Web.UI.RadGrid.ExportToPdfCommandName)
{
foreach (GridColumn col in RadGridChild.MasterTableView.AutoGeneratedColumns)
{
if (!col.Display)
{
col.Display = false;
col.Visible = false;
}
}
}
Any help would be greatly appreciated.
Kind Regards