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

Key cannot be null. Parameter name: key

1 Answer 474 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
bharat veer
Top achievements
Rank 1
bharat veer asked on 25 Mar 2011, 08:05 PM
Hi Sir,
i am binding my RadGrid with ORM like this

oadsSource.ObjectContextProvider = "RadControlApplication.EntitiesModel, RadControlApplication";
        oadsSource.TypeName = "RadControlApplication.TblCustomer";
        oadsSource.EnableDelete = false;
        oadsSource.EnableUpdate = false;
        oadsSource.EnableInsert = false;
        oadsSource.StoreOriginalValuesInViewState = false;
        rdGridCustomer.DataSourceID = "oadsSource";


here oadsSource is the object of my OpenAccessDataSource control, that i put in my aspx page.
and RadGrid is bound properly.


i am setting the properties of my radGrid for Excel Exporting as
        rdGridCustomer.ExportSettings.FileName = "MyDataFile";
        rdGridCustomer.ExportSettings.ExportOnlyData = true;
        rdGridCustomer.ExportSettings.IgnorePaging = false;
        rdGridCustomer.ExportSettings.OpenInNewWindow = true;
        rdGridCustomer.ExportSettings.Excel.FileExtension = "xls";
        rdGridCustomer.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML;

  now on button click event i am writing this code

  this.rdGridCustomer.MasterTableView.ExportToExcel();
but i am facing the error
Key cannot be null. Parameter name: key
But if i bind my RadGrid with other data source like SQLDATASOURCE then its work fine.no error occurs.
and if i use other datasource like datatable then also its work fine for export in ExcelML format.
But i have to use ORM actuly.
I need solution please.
Thanks very much

1 Answer, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 29 Mar 2011, 04:19 PM
Hi bharat veer,

I am afraid that I was not able to reproduce the wrong behavior on my side.
You could find the sample application that I used to test this behavior attached. I should ask you to provide us with a sample application that shows the wrong behavior to investigate the issue further.
I am looking forward to hearing from you.

All the best,
Damyan Bogoev
the Telerik team
Tags
General Discussions
Asked by
bharat veer
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Share this question
or