[Mono-bugs] [Bug 433669] New: DataGridView crashes application after second assignment to DataSource

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Oct 8 16:36:02 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=433669


           Summary: DataGridView crashes application after second assignment
                    to DataSource
           Product: Mono: Class Libraries
           Version: 2.0
          Platform: x86
        OS/Version: openSUSE 11.0
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: Tomasz.Kubacki at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=244443)
 --> (https://bugzilla.novell.com/attachment.cgi?id=244443)
MonoDevelop project to reproduce bug

(I've used vmware edition of Suse 11 reached from
http://ftp.novell.com/pub/mono/vmware/Mono-2.0_openSUSE-11.0.zip.torrent)


After second assignment to DataSource Property of the DataGridView control. App
crashes with message:

Unhandled Exception: System.ArgumentOutOfRangeException: Index is less than 0
or more than or equal to the list count.
Parameter name: index
1
  at System.Collections.ArrayList.get_Item (Int32 index) [0x00032] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/corlib/System.Collections/ArrayList.cs:2652 
  at System.Windows.Forms.DataGridViewColumnCollection.get_Item (Int32 index)
[0x00000] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewColumnCollection.cs:57 
  at (wrapper remoting-invoke-with-check)
System.Windows.Forms.DataGridViewColumnCollection:get_Item (int)
  at System.Windows.Forms.DataGridViewRowCollection.AddInternal
(System.Windows.Forms.DataGridViewRow dataGridViewRow, Boolean sharable)
[0x000e0] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs:140 
  at System.Windows.Forms.DataGridView.PrepareEditingRow (Boolean cell_changed,
Boolean column_changed) [0x0009e] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs:5486 
  at System.Windows.Forms.DataGridView.OnColumnAddedInternal
(System.Windows.Forms.DataGridViewColumnEventArgs e) [0x000b8] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs:3517 
  at (wrapper remoting-invoke-with-check)
System.Windows.Forms.DataGridView:OnColumnAddedInternal
(System.Windows.Forms.DataGridViewColumnEventArgs)
  at System.Windows.Forms.DataGridViewColumnCollection.Add
(System.Windows.Forms.DataGridViewColumn dataGridViewColumn) [0x0002a] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewColumnCollection.cs:83 
  at System.Windows.Forms.DataGridView.GenerateColumnsFromType (System.Type
type) [0x00087] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs:5579 
  at System.Windows.Forms.DataGridView.BindIList (IList list) [0x000f4] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs:5523 
  at System.Windows.Forms.DataGridView.DoBinding () [0x00094] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs:5644 
  at System.Windows.Forms.DataGridView.set_DataSource (System.Object value)
[0x00061] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs:659 
  at (wrapper remoting-invoke-with-check)
System.Windows.Forms.DataGridView:set_DataSource (object)
  at DataGridViewBug.MainClass+<Main>c__AnonStorey0.<>m__0 (System.Object e,
System.EventArgs s) [0x00000] in
/home/linux/DataGridViewBug/DataGridViewBug/Main.cs:22 
  at System.Windows.Forms.Control.OnClick (System.EventArgs e) [0x0001c] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:6005 
  at System.Windows.Forms.Button.OnClick (System.EventArgs e) [0x00024] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Button.cs:106 
  at System.Windows.Forms.ButtonBase.OnMouseUp
(System.Windows.Forms.MouseEventArgs mevent) [0x00081] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBase.cs:634 
  at System.Windows.Forms.Button.OnMouseUp (System.Windows.Forms.MouseEventArgs
mevent) [0x00000] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Button.cs:128 
  at System.Windows.Forms.Control.WmLButtonUp (System.Windows.Forms.Message& m)
[0x00081] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5567 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m)
[0x0017c] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5309 
  at System.Windows.Forms.ButtonBase.WndProc (System.Windows.Forms.Message& m)
[0x00055] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBase.cs:692 
  at System.Windows.Forms.Button.WndProc (System.Windows.Forms.Message& m)
[0x00000] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Button.cs:150 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage
(System.Windows.Forms.Message& m) [0x00000] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:227 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc
(System.Windows.Forms.Message& m) [0x00000] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:208 
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr
wParam, IntPtr lParam) [0x00084] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/NativeWindow.cs:240 
  at System.Windows.Forms.XplatUIX11.DispatchMessage (System.Windows.Forms.MSG&
msg) [0x00000] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:3302 
  at System.Windows.Forms.XplatUI.DispatchMessage (System.Windows.Forms.MSG&
msg) [0x00000] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs:600 
  at System.Windows.Forms.Application.RunLoop (Boolean Modal,
System.Windows.Forms.ApplicationContext context) [0x00359] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:954 
  at System.Windows.Forms.Form.ShowDialog (IWin32Window owner) [0x00102] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs:1754 
  at System.Windows.Forms.Form.ShowDialog () [0x00000] in
/usr/src/packages/BUILD/mono-2.0/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs:1679 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Form:ShowDialog
()
  at DataGridViewBug.MainClass.Main (System.String[] args) [0x0005e] in
/home/linux/DataGridViewBug/DataGridViewBug/Main.cs:24 

----------------------------
STEPS TO REPRODUCE:
Run below application and press test button twice.


using System;
using System.Windows.Forms;

namespace DataGridViewBug
{
        class MainClass
        {
                public static void Main(string[] args)
                {
                        Form f = new Form();                    
                        DataGridView dgw = new DataGridView();
                        f.Controls.Add(dgw);
                        Button b = new Button();
                        b.Text="test";
                        b.Dock = DockStyle.Bottom;

                        b.Click += (e,s) =>{dgw.DataSource = new A[]{new
A(),new A()};};
                        f.Controls.Add(b);
                        f.ShowDialog();
                }




        }



        public class A{
                public string Name{
                        get{
                                return "asdasdas";
                        }
                }
        }
}


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list