This is a migrated thread and some comments may be shown as answers.

Exporting a grid without detailtables

1 Answer 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bart
Top achievements
Rank 1
Bart asked on 11 Jul 2008, 02:06 PM
I'm currently building a grid that display's orders, and orderlines in a subgrid. I'd like to provide the functionality to export the grid to csv, pdf, and so on, but i want to set it up in such a way that the grid only exports the mastertableview, not the detailtables.
I tried using the HierarchyDefaultExpanded property, but it didn't work out. Also i tried saving the DetailTables-collection in a variable, clearing the collection in the grid, and then exporting. That works, but i just can't seem to get the DetailTables back into the grid afterwards.
I've been looking into this for the better part of the day, and i figured someone must have encountered this problem before, Any and all tips and suggestions will be welcomed.
Thanks in advance!

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 14 Jul 2008, 08:03 AM
Hello Bart,

Try out the following  approach and see if it helps..

CS:
protected void Button1_Click(object sender, EventArgs e) 
    { 
        RadGrid2.ExportSettings.OpenInNewWindow = true
        RadGrid2.ExportSettings.ExportOnlyData = true
        RadGrid2.MasterTableView.AllowPaging = false
        RadGrid2.Rebind(); 
        RadGrid2.MasterTableView.ExportToExcel(); 
        
    } 

Thanks
Princy.

Tags
Grid
Asked by
Bart
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or