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

How to Customize The Columns Exported in a RadGrid?

3 Answers 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pooya
Top achievements
Rank 1
Pooya asked on 01 Apr 2011, 09:19 AM
I have a radgrid control which is bound to some data.
One of the columns is an image that I'd like to be excluded from my export button.
How can this be done?

Thanks

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 01 Apr 2011, 09:41 AM
Hello Pooya,


It is achievable by hiding the code before exporting the grid.

Code:
protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) 
    
        if (e.CommandName == RadGrid.ExportToExcelCommandName) 
        {            
            RadGrid1.MasterTableView.GetColumn("ColumnUniqueName").Visible = false
        
    }


Regards,
Princy.
0
Pooya
Top achievements
Rank 1
answered on 01 Apr 2011, 09:53 AM
Thanks :), it's sorted.

I have another issue that when I export the grid, it only exports the page which is shown whereas I'd need to export all the data of all pages.

I set the IgnorePaging = true but didn't help.

?
0
Daniel
Telerik team
answered on 05 Apr 2011, 11:27 PM
Hello Pooya,

This usually happens when using simple data-binding. Please consider using advanced data-binding or datasource control instead.
Simple data-binding
Advanced data-binding

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
Pooya
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Pooya
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or