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: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
          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.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to