Still getting used to ORM (open access) and have created a grid on a web page that is changes its data source on a tab click and refreshes to show a single different table
The problem is when you try to edit an item in a grid row it produces an error;
"There was a problem extracting DataKeyValues from the DataSource. Please ensure that SDataKeyNames are specified correctly and all feilds exist in the Datasource."
I have not been able to degug to find what the values are.
It is coded in .net 3.5 with latest 2009 version of open access and rad grid
The technique to change data is in NeedDataSource as follows;
protected
void RadGridTable_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
string cDataSourceTypeName = "RGLdata.TblContactType" // the open access class where data stored
string cMasterTableViewDataKeyNames = "ContactTypeId"; // the primaary key feild in correct case with no spaces of the above table
OpenAccessDataSource1.TypeName = cDataSourceTypeName;
// blank all before add new
RadGridTable.DataSourceID =
"";
RadGridTable.MasterTableView.DataSourceID =
"";
RadGridTable.MasterTableView.DataKeyNames =
new string[] {};
// add correct sources
RadGridTable.DataSourceID =
"OpenAccessDataSource1" ;
RadGridTable.MasterTableView.DataSourceID =
"OpenAccessDataSource1";
RadGridTable.MasterTableView.DataKeyNames =
new string[] { cMasterTableViewDataKeyNames };
No databind or datarebind is called in needdatasource
Any ideas on what to change, to enable edit in grid !
Rgds
Stephen