2006-12-27 Igor Zelmanovich <igorz@mainsoft.com>
authorIgor Zelmanovich <igorz@mono-cvs.ximian.com>
Wed, 27 Dec 2006 09:05:46 +0000 (09:05 -0000)
committerIgor Zelmanovich <igorz@mono-cvs.ximian.com>
Wed, 27 Dec 2006 09:05:46 +0000 (09:05 -0000)
* ListControl.cs: fixed: when is used with DataSourceID data bind is not
perfomed on PostBack because Items collection is restored from View state.

svn path=/trunk/mcs/; revision=70112

mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs

index b7fc00940a6d3efe0d9b0e10052c9a0e09efe113..c7c1611fc4abf21a5a500ca3e04450db745b9e65 100644 (file)
@@ -1,3 +1,8 @@
+2006-12-27 Igor Zelmanovich <igorz@mainsoft.com>
+
+       * ListControl.cs: fixed: when is used with DataSourceID data bind is not 
+       perfomed on PostBack because Items collection is restored from View state.       
+
 2006-12-26 Igor Zelmanovich <igorz@mainsoft.com>
 
        * DataGridPagerStyle.cs:
index 63d634ce25e48fc0a1ae57adcc31ba186b509dfc..fb88c6e009433eb8c55467ca9aa2feb0db0443b5 100644 (file)
@@ -420,10 +420,10 @@ namespace System.Web.UI.WebControls {
                        DoDataBinding (dataSource);
                }
 
-               [MonoTODO ("why override?")]
                protected override void PerformSelect ()
                {
                        base.PerformSelect ();
+                       ViewState ["_DataBound"] = true;
                }
 
                protected internal override void RenderContents (HtmlTextWriter writer)
@@ -510,6 +510,11 @@ namespace System.Web.UI.WebControls {
                                foreach (int index in indices)
                                        Items [index].Selected = true;
                        }
+
+#if NET_2_0
+                       if (ViewState ["_DataBound"] != null)
+                               RequiresDataBinding = !(bool) ViewState ["_DataBound"];
+#endif
                }
 
 #if NET_2_0