Issue at RadGrid row updating

Thread is closed for posting
5 posts, 1 answers
  1. Dmitry
    Dmitry avatar
    4 posts
    Member since:
    Nov 2008

    Posted 11 Nov 2008 Link to this post

    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.


  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 15 Nov 2008 Link to this post

    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.
  3. Answer
    Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 18 Nov 2008 Link to this post

    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.
  4. Dmitry
    Dmitry avatar
    4 posts
    Member since:
    Nov 2008

    Posted 19 Nov 2008 Link to this post

    Thank you, it works.
  5. Andrew
    Andrew avatar
    70 posts
    Member since:
    Oct 2008

    Posted 26 May 2009 Link to this post

    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.
Back to Top