update a key field in a gridview
Posted on 2006-07-20
In ASP.NET 2.0 with C# I have a page with sqldatasource and a gridview.
the gridview datakeynames consists of 2 fields. I have a demand to update one of the key fields the second key.
I thought of including in the gridview another invisible field that will keep the old value of the second key
and in the update command I will point in the where clause to this field. but the problem is that
the GridViewUpdateEventArgs.oldvalues does not contain the key at all in its list because it is a key field.
How can I update a key field in a gridview?