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

RadGrid must be databound before exporting

1 Answer 191 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Atif
Top achievements
Rank 1
Atif asked on 07 Sep 2010, 07:19 AM
Before clicking on filter button i click on export excel button because of no data in telerik radgrid  it generate error
 
RadGrid must be databound before exporting

Try
            gvDomainRegDetail.ExportSettings.FileName = "FileName"
            gvDomainRegDetail.ExportSettings.ExportOnlyData = True
            gvDomainRegDetail.ExportSettings.IgnorePaging = True
            gvDomainRegDetail.ExportSettings.OpenInNewWindow = True
            'gvDomainRegDetail.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML
            gvDomainRegDetail.MasterTableView.ExportToExcel()

        Catch ex As Exception
            Msg_Error(Master, "Error: " & ex.Message)
        End Try


How to fix this error.please any body have idea 

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 07 Sep 2010, 08:48 AM
Hi Atif,

Please let us know how you populated your RadGrid. I suggest you consider adding a NeedDataSource handler and bind the control inside this handler.

More information about NeedDataSource:
Advanced data-binding w/NeedDataSource

Additionally, verify that the RadGrid control is added to Page's controls collection before exporting.

Let us know if you need further assistance.

Greetings,
Pavlina
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
Atif
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or