[Mono-dev] [PATCH] System.Web: GridView binding on postback

Konstantin Triger kostat at mainsoft.com
Sun Jul 2 08:53:32 EDT 2006



I had a problem with EditItemTemplate of gridview: it did not update the values. This happens because of several reasons:

1. BoundField.cs: the TextBox did not have an ID, so the browser did not correctly send the new value.

2. GridView.cs: in CreateChildControls, the row binding happened after all rows were created. But GetRowValues accesses those values, thus the binding should happened before the call to GetRowValues.

3. DataBoundControl.cs: the binding should be carefully regulated otherwise we can bind over postback values! So I implemented MarkAsDataBound() and use it to decide if I need to rebind in OnLoad. PerformSelect() sets it.


Attached a patch fixing this, please review.



Konstantin Triger


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060702/cb4e1658/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: postback_databind.patch
Type: application/octet-stream
Size: 2670 bytes
Desc: postback_databind.patch
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060702/cb4e1658/attachment.obj 

More information about the Mono-devel-list mailing list