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

Export all columns to Excel

1 Answer 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Larry Mrazek
Top achievements
Rank 1
Larry Mrazek asked on 13 Sep 2010, 07:21 PM
Hi Folks:

Quick question. I have a RadGrid Displaying about 6 of 25 fields from a table. Of course, when I try to export to excel using the built-in tools, I only get the displayed fields ... is there a way where I could export all of those fields, or setup a different export procedure to export all of the fields.

Thanks in advance.

Larry

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 13 Sep 2010, 09:53 PM
Hello Larry,

It depends on your scenario. If your columns are hidden, you could show them before export.

Sample code:
protected void ExportButton_Click(object sender, EventArgs e)
{
    foreach (GridColumn col in RadGrid1.MasterTableView.Columns)
    {
        col.Visible = true;
    }
    ...
}

If these columns are not available in the current datasource, you could temporary bind RadGrid to show the missing columns before export.

Let me know if you need more information.

Best regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Larry Mrazek
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or