开发者

Updating Only Changed Rows Using GridView Control

what is the best way of updating 开发者_StackOverflowto db only the changed rows using gridview?

i have a gridview control that has inline editing and when the user edit the row there are two options "Update" or "Cancel" so user might just click update button without really updating the row...

how can i make sure that, user really changed the row?


I don't use it much but are you sure the GridView doesn't handle that automatically if you are using the built in edit functionality. You could try debugging the OnRowUpdated and OnRowUpdating methods to see if they even get called when save is clicked and nothing has been changed. Even if you don't need them just add them so you can put a break point there to see if they get triggered.


i could not find what i wanted to do so the easiest way of doing this is:

load the data in a object and compare with Equals it works fine in my scenario and the only cons is trip to db which is fine in my case.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜