R
Raja
Hi Everybody
Just playing with ObjectDataSource and noticed the following.
I have a Gridview which binds to a ObjectDataSource. ObjectDataSource
gets data from a typed dataset created with VWD. In the table from
which the data is coming has a Primary Key field.
Gridview is set to edit mode. DataKeyNames = "PK_Field". Now if PK
field is not readonly, then data is updated successfully. But if I set
PK Field to readonly, then data is not updated. During the debugging I
see that e.InputParameters does not return any value for readonly PK
field. Probably no textbox created for readonly field, so no value.
How can I have the Gridview to update a record with readonly Primary
Key field?
Offcourse, there are many other ways to update, but I do not believe
that if I turn my PK field to readonly, then I have to change a lot of
code.
I must be missing something.
Just playing with ObjectDataSource and noticed the following.
I have a Gridview which binds to a ObjectDataSource. ObjectDataSource
gets data from a typed dataset created with VWD. In the table from
which the data is coming has a Primary Key field.
Gridview is set to edit mode. DataKeyNames = "PK_Field". Now if PK
field is not readonly, then data is updated successfully. But if I set
PK Field to readonly, then data is not updated. During the debugging I
see that e.InputParameters does not return any value for readonly PK
field. Probably no textbox created for readonly field, so no value.
How can I have the Gridview to update a record with readonly Primary
Key field?
Offcourse, there are many other ways to update, but I do not believe
that if I turn my PK field to readonly, then I have to change a lot of
code.
I must be missing something.