Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorVladimir Krasnov <krasnov@mono-cvs.ximian.com>2006-02-27 20:35:36 +0300
committerVladimir Krasnov <krasnov@mono-cvs.ximian.com>2006-02-27 20:35:36 +0300
commit682ef77c88696287762ad613285dff5684dad1b5 (patch)
treee0cf7b193720037831be54140d04891739369529 /mcs
parenta34e681bc34591420b80a7e193bbd166a3bb2013 (diff)
* ListControl.cs: fixed SelectedIndex property, fixed selection reset on incorrect value
svn path=/trunk/mcs/; revision=57335
Diffstat (limited to 'mcs')
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog5
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs11
2 files changed, 11 insertions, 5 deletions
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
index c847b79b0b3..86fe8aab54f 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
@@ -1,5 +1,10 @@
2006-02-27 Vladimir Krasnov <vladimirk@mainsoft.com>
+ * ListControl.cs: fixed SelectedIndex property, fixed selection
+ reset on incorrect value
+
+2006-02-27 Vladimir Krasnov <vladimirk@mainsoft.com>
+
* TableStyle.cs: fixed AddAttributesToRender function, style
BorderCollapse:Collapse was added if table's CellSpacing is zero
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs
index 6f80858eb14..6da296b7f96 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs
@@ -196,10 +196,6 @@ namespace System.Web.UI.WebControls {
return -1;
}
set {
- ClearSelection ();
- if (value == -1)
- return;
-
if (items == null || items.Count == 0) {
// This will happen when assigning this property
// before DataBind () is called on the control.
@@ -207,8 +203,13 @@ namespace System.Web.UI.WebControls {
return;
}
- if (value < 0 || value >= Items.Count)
+ if (value < -1 || value >= Items.Count)
throw new ArgumentOutOfRangeException ("value");
+
+ ClearSelection ();
+ if (value == -1)
+ return;
+
items [value].Selected = true;
/* you'd think this would be called, but noooo */