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

How to change the value of GridBoundColumn that represents a Primary Key

1 Answer 106 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tariq
Top achievements
Rank 1
Tariq asked on 21 Oct 2008, 02:28 PM
I have a RadGrid which is connected to a single SQL Server table that contains only three fields. One field in this table (UserID) is the Primary Key.

I can successfully edit values in the regular two fields but cannot change the value of the Primary Key field. When I click at the "Update" button after changing the value in the PK field, it returns the same old value. Here is my "UpdateCommand". Apparently it does not save it in the table.

UpdateCommand
="UPDATE TestEmp SET UserID = @UserID, UserName = @UserName, Department = @Department WHERE (UserID = @UserID)">

Thank you.

Tariq

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 23 Oct 2008, 11:07 AM
Hi Tariq,

Please, make sure that the ReadOnly property for the field is not turned on in the grid declaration, for the column which binds to this PK field.

Best wishes,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Tariq
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or