From 8fb9aa295c02a4adc7fe98e1237aa86953977f5f Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Fri, 12 Sep 2008 17:08:12 +0000 Subject: [PATCH] 2008-09-12 Carlos Alberto Cortez * ListBox.cs: When calling Items.Clear(), call SelectedIndexCollection.ClearCore instead of normal Clear method, to not fire any Selected*Changed event - this is done to match .net and don't have invalid values when changing the DataSourceProperty. Fixes #424273. svn path=/trunk/mcs/; revision=112895 --- .../Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 8 ++++++++ .../Managed.Windows.Forms/System.Windows.Forms/ListBox.cs | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index d021028a5e1..b811adf246b 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,11 @@ +2008-09-12 Carlos Alberto Cortez + + * ListBox.cs: When calling Items.Clear(), call + SelectedIndexCollection.ClearCore instead of normal Clear method, to + not fire any Selected*Changed event - this is done to match .net and + don't have invalid values when changing the DataSourceProperty. + Fixes #424273. + 2008-09-12 Mario Carrion * HelpProvider.cs: Control enabled to support accessibility. diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs index 727eb4e3301..86f9a0d5514 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs @@ -2554,7 +2554,7 @@ namespace System.Windows.Forms public virtual void Clear () { - owner.selected_indices.Clear (); + owner.selected_indices.ClearCore (); object_items.Clear (); owner.CollectionChanged (); -- 2.25.1