[Mono-bugs] [Bug 464493] When a DataGridView is linked to a datatable, setting the column property to false throws an exception

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat May 9 12:03:58 EDT 2009


User M8R-2yr72d at mailinator.com added comment

qvacfcajdjw at mailinator.com M8R-2yr72d at mailinator.com <M8R-2yr72d at mailinator.com> changed:

           What    |Removed                     |Added
           Priority|P5 - None                   |P2 - High
                 CC|                            |M8R-2yr72d at mailinator.com
   Target Milestone|---                         |2.6.x
               Flag|                            |SHIP_STOPPER?

--- Comment #6 from qvacfcajdjw at mailinator.com M8R-2yr72d at mailinator.com <M8R-2yr72d at mailinator.com>  2009-05-09 10:03:55 MDT ---
To simplify the test case:

            DataTable tableMain = new DataTable();
            tableMain.Columns.Add("AccountID", Type.GetType("System.Int32"));
            gridMain.DataSource = tableMain;
            gridMain.Columns[0].HeaderText = "aapje";


rupert at linux:~/Desktop> mono WindowsFormsApplication1.exe

Unhandled Exception: System.ArgumentOutOfRangeException: Index is less than 0
or more than or equal to the list count.
Parameter name: index
  at System.Collections.ArrayList.ThrowNewArgumentOutOfRangeException
(System.String name, System.Object actual, System.String message) [0x00000] 
  at System.Collections.ArrayList.get_Item (Int32 index) [0x00000] 
  at System.Windows.Forms.DataGridViewColumnCollection.get_Item (Int32 index)
  at (wrapper remoting-invoke-with-check)
System.Windows.Forms.DataGridViewColumnCollection:get_Item (int)
  at WindowsFormsApplication1.Form1..ctor () [0x00000] 
  at (wrapper remoting-invoke-with-check) WindowsFormsApplication1.Form1:.ctor
  at WindowsFormsApplication1.Program.Main () [0x00000] 

It appears gridMain does not have any columns (so the tableMain was not
correctly associated with gridMain). I would think this is a major bug as the
Datasource property fails.

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

More information about the mono-bugs mailing list