[Mono-bugs] [Bug 464493] New: 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
Thu Jan 8 10:32:29 EST 2009


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


           Summary: When a DataGridView is linked to a datatable, setting
                    the column property to false throws an exception
           Product: Mono: Class Libraries
           Version: 2.2.x
          Platform: x86
        OS/Version: openSUSE 11.1
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: fxhat.mail at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Community User


Note: I used the Mono version included in the openSuSE 11.1 gnome live cd;
don't know if I specified the correct version above.

Relevant code:

[code]
            DataTable tableMain = new DataTable();
            tableMain.Columns.Add( "AccountID", Type.GetType("System.Int32"));
            tableMain.Columns.Add( "AccountName",
Type.GetType("System.String"));
            tableMain.Columns.Add( "AccountInformation",
Type.GetType("System.String"));

            tableMain.Rows.Add( new object[] { 1, "Just an account name",
"Nothing to report" });

            gridMain.DataSource = tableMain;

            gridMain.Columns[0].Visible = false;
            gridMain.Columns[1].HeaderText = "Account name";
            gridMain.Columns[1].FillWeight = 200;
            gridMain.Columns[2].HeaderText = "Account Information";
[/code]

Create a new Windows Forms project (using Visual Studio 2008 for example). Add
the code above to the form constructor. Add a DataGridView to the form in
design mode called "gridMain".

The above code will run perfectly under .Net 2.0. The above code will fail on
Mono. If you comment out the line:             gridMain.Columns[0].Visible =
false; the application will also run fine under mono. 

This line thus throws the exception, which is a bug.


-- 
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