Is there any way to track which lines in Gridview are modified? I load gridview used like开发者_JAVA技巧 a excel sheet that is fetched from a table, I want to set a flag modfied == Y when the line is modified by a User. Any idea how to approach this problem.
Thank you in advance :)
Matt Dotson's BulkEditGridview has the concept of "dirty" rows, and may be a control that will do what you're looking for.
Download here: ASP.NET Real World Controls
If you don't want to go with a 3rd party control, you could use HiddenFields in your gridview. Create one for each field you want to keep track of, and when you go back to save changes, check if the value in the field does not match the value in the corresponding hiddenfield.
Works like a charm if you've only got a few fields you need to keep track of; however it gets a bit cumbersome if you've got 25 fields you want to monitor.
精彩评论