+2003-06-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * ListControl.cs: save viewstate data when any of the 3 values is not
+ null. Fixed condition to save selection indices. Closes bug #45493.
+
2003-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* DataGrid.cs: fixed bug #43823.
object vs = base.SaveViewState();\r
object itemSvs = Items.SaveViewState();\r
object indices = null;\r
- if(SaveSelectedIndicesViewState)\r
+ if (SaveSelectedIndicesViewState)\r
indices = SelectedIndices;\r
- if(vs!= null && itemSvs != null && indices != null)\r
- {\r
+\r
+ if (vs != null || itemSvs != null || indices != null)\r
return new Triplet(vs, itemSvs, indices);\r
- }\r
+\r
return null;\r
}\r
\r
Items.TrackViewState();\r
}\r
\r
- private bool SaveSelectedIndicesViewState\r
- {\r
- get\r
- {\r
- if( Events[SelectedIndexChangedEvent] != null && Enabled && Visible)\r
- {\r
+ private bool SaveSelectedIndicesViewState {\r
+ get {\r
+ if (Events[SelectedIndexChangedEvent] == null && Enabled && Visible) {\r
Type t = GetType();\r
// If I am a derivative, let it take of storing the selected indices.\r
- if(t == typeof(DropDownList) || t == typeof(ListBox) || t == typeof(CheckBoxList) || t == typeof(RadioButtonList))\r
+ if (t == typeof(DropDownList) || t == typeof(ListBox) ||\r
+ t == typeof(CheckBoxList) || t == typeof(RadioButtonList))\r
return false;\r
}\r
return true;\r