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

Add columns before export

1 Answer 50 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Josh
Top achievements
Rank 1
Josh asked on 07 Dec 2012, 02:04 PM
I have a grid that is pulling data from a stored procedure. When I export, I want to query another stored procedure that has many additional columns of data returned. Is it possible to bind my grid to a separate datasource prior to exporting to excel or pdf? It is not an option for me to loop through the columns returned and show/hide each one. Any thoughts are appreciated!

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 10 Dec 2012, 05:20 AM
Hello,

As per my knowledge with RadGrid it is not possible (without column show/hide).

For export you have to take another grid with visible='false'.

Like :
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.CommandName == RadGrid.ExportToPdfCommandName)
        {
            e.Canceled = true;
            RadGrid2.MasterTableView.ExportToPdf();
            RadGrid2.Rebind();
        }
    }


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Josh
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or