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

Export alternate table field to excel

3 Answers 81 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 16 Jan 2013, 03:07 PM
I am exporting my grid and it works fine, but there are a couple fileds i do not show on the grid as they are note fields and have a lot of characters and the viewstate would get massive, so I show them in a popup service on the grid.  however when they export the grid they want the notes to go with the export, how can I change the export to include the notes field when I do not pull into the original grid because it would be massive.

Is there a way to pull a seperate sql query for an alternate view just for export only that pulls the notes field then does rebinds real view.

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 17 Jan 2013, 09:33 AM
Hi,

One suggestion is that you can show the column on exporting as shown below.
C#:
void export_Click(object sender, EventArgs e)
{
        RadGrid2.MasterTableView.GetColumn("").Visible = true;
        RadGrid2.MasterTableView.ExportToExcel();
}


Thanks,
Princy
0
Kevin
Top achievements
Rank 1
answered on 17 Jan 2013, 01:35 PM
hi princy,

I know I could do the visible method but my view state of the project and amount of data pulling back into the grid would be considerable.  IF I am understanding you this woul dbe the only way to do it with a telerik grid.  There is no way to pull and alternate sql query and then export that instead of what lies in the grid itself so that I do not have to bring in the notes.  These notes field are upwards of 10000 characters for each field.
0
Daniel
Telerik team
answered on 22 Jan 2013, 03:28 PM
Hello Kevin,

You can replace the datasource before exporting. This is demonstrated in the attached website.

Kind regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Kevin
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Kevin
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or