Click here to Skip to main content
16,020,313 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
My problem is i have table which doesn't contain primary key and i am binding this table to grid view its working perfectly. now i need to update gridview using boundfield without datakeys.
so please suggest us suitable code.
Posted

1 solution

If you don't have DataKey, then you need to store the Key somewhere inside the Row either in a HiddenField or BoundField or something.

Then inside GridView.RowUpdating Event[^], find that field and retrieve the value. After that run a Query on your Database using that Key or Id.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900