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

Issue at RadGrid row updating

4 Answers 143 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dmitry
Top achievements
Rank 1
Dmitry asked on 11 Nov 2008, 10:27 PM
Hello,

I've selected OpenAccessDataSource as a dataSource of my RadGrid and choosen automatic-generated insert, delete and update command provided by RadGrid capabilities. I am able to insert rows to the grid without any errors and it normally reflects in the database. But when I try to update or to delete any row I get the following exception:

Changes are not possible if the primary key fields are not visible.
Please specify the id and version fields in the persistent attribute.
[Telerik.OpenAccess.Persistent(IdentityFied="id", VersionField="version"]

It's hard to understand how primary key fields can be not visible. Not visible for whom?

The version field is not set in the persistent attribute on my class. I wonder if version is really required in my case. For test I've tried to generate my version column and set version field to be equal its name, but it didn't fix the issue. Please, advise.

Thanks.


4 Answers, 1 is accepted

Sort by
0
Jan Blessenohl
Telerik team
answered on 15 Nov 2008, 11:22 AM
Hello Dmitry,

I think you are doing it right. OpenAccessDatasource needs the id field handled back from the UI. It seems that this is not happening. I have to investigate a little more, will come back to you on monday.

Best wishes,
Jan Blessenohl
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Accepted
Jan Blessenohl
Telerik team
answered on 18 Nov 2008, 12:48 PM
Hi Dmitry,

I have fixed you problem, the DataSource will do the right settings. In the mean time you can do it by hand by adding datakeynames to the MasterTableView.

<MasterTableView datakeynames="OrderID" ... 

I you use any other control pls. look for the DataKeyNames, we need this information to store the changes into the right object.

All the best,
Jan Blessenohl
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Dmitry
Top achievements
Rank 1
answered on 19 Nov 2008, 09:45 PM
Thank you, it works.
0
Andrew
Top achievements
Rank 1
answered on 26 May 2009, 11:26 PM
Might I point out that using the 2009.1.423.2 version of OA this issue is still present - I had to add the keyfield (datakeynames) manually.

Now I know it is an issue it is easy to deal with, but it has taken me a day to rediscover this thread and hence the necessary fix.
Tags
General Discussions
Asked by
Dmitry
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
Dmitry
Top achievements
Rank 1
Andrew
Top achievements
Rank 1
Share this question
or