2009-02-28 Carlos Alberto Cortez <calberto.cortez@gmail.com>
authorCarlos Alberto Cortez <calberto.cortez@gmail.com>
Sat, 28 Feb 2009 12:39:44 +0000 (12:39 -0000)
committerCarlos Alberto Cortez <calberto.cortez@gmail.com>
Sat, 28 Feb 2009 12:39:44 +0000 (12:39 -0000)
* ListView.cs: In our MouseDown handler in ItemControl use the item in
the very specific *real* position where the mouse was pressed, using
GetItemAtDisplayIndex for that purpose, instead of directly accessing
Items - this is specially useful when groups with Details view is
used. This is what we do in other places when using groups.
Fixes part of #478689.

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

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs

index 22ca41c0eb387d359b352f86e756ad42bd0a9866..5500e15c8708ccdcb2a64cedbc49e7e685e3da2a 100644 (file)
@@ -1,3 +1,12 @@
+2009-02-28  Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+       * ListView.cs: In our MouseDown handler in ItemControl use the item in
+       the very specific *real* position where the mouse was pressed, using
+       GetItemAtDisplayIndex for that purpose, instead of directly accessing
+       Items - this is specially useful when groups with Details view is
+       used. This is what we do in other places when using groups.
+       Fixes part of #478689.
+
 2009-02-27  Carlos Alberto Cortez <calberto.cortez@gmail.com> 
 
        * MaskedTextBox.cs: Properly replace selection when a new valid key
index 1ba1f9a719964824513a90809650c1e37e35325a..94b75abf43cd3e85d713f8e204b095d5686bf43d 100644 (file)
@@ -2644,7 +2644,7 @@ namespace System.Windows.Forms
                                        if (owner.View == View.Details) {
                                                bool over_text = item.TextBounds.Contains (pt);
                                                if (owner.FullRowSelect) {
-                                                       clicked_item = owner.items [i];
+                                                       clicked_item = item;
                                                        bool over_item_column = (me.X > owner.Columns[0].X && me.X < owner.Columns[0].X + owner.Columns[0].Width);
                                                        if (!over_text && over_item_column && owner.MultiSelect)
                                                                box_selecting = true;