[Mono-bugs] [Bug 400390] New: ListView VirtualMode=GridLines=true junks

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Jun 14 22:58:40 EDT 2008


           Summary: ListView VirtualMode=GridLines=true junks
           Product: Mono: Class Libraries
           Version: 1.9.0
          Platform: x86-64
               URL: http:///
        OS/Version: Linux
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: Dax at daxxfiles.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

Description of Problem:

Using System.Windows.Forms.ListView under Mono/Linux (probably other OSes as
well) with VirtualMode and GridLines both set to true will produce a nice
error. Deactivating either of both solves this. 

Steps to reproduce the problem:
Compile and run:
public class Program : Form
                ListView lv = new ListView();
                lv.Parent = this;
                lv.Dock = DockStyle.Fill;
                lv.View = View.Details;
                lv.VirtualMode = true;
                lv.GridLines = true;

        void foo(object sender, RetrieveVirtualItemEventArgs e)
                e.Item = new ListViewItem(e.ItemIndex.ToString());

        static void Main()
                Application.Run(new Program());

Actual Results:

Unhandled Exception: System.InvalidOperationException: Operation is not valid
due to the current state of the object
  at System.Windows.Forms.ListView+ListViewItemCollection.GetEnumerator ()
  at System.Windows.Forms.ThemeWin32Classic.DrawListViewItems
(System.Drawing.Graphics dc, Rectangle clip, System.Windows.Forms.ListView
control) [0x00000] 
  at System.Windows.Forms.ListView+ItemControl.OnPaintInternal
(System.Windows.Forms.PaintEventArgs pe) [0x00000] 
  at System.Windows.Forms.Control.WmPaint (System.Windows.Forms.Message& m)
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m)
  at System.Windows.Forms.ListView+ItemControl.WndProc
(System.Windows.Forms.Message& m) [0x00000] 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage
(System.Windows.Forms.Message& m) [0x00000] 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc
(System.Windows.Forms.Message& m) [0x00000] 
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr
wParam, IntPtr lParam) [0x00000] 
  at System.Windows.Forms.XplatUIX11.DispatchMessage (System.Windows.Forms.MSG&
msg) [0x00000] 
  at System.Windows.Forms.XplatUI.DispatchMessage (System.Windows.Forms.MSG&
msg) [0x00000] 
  at System.Windows.Forms.Application.RunLoop (Boolean Modal,
System.Windows.Forms.ApplicationContext context) [0x00000] 
  at System.Windows.Forms.Application.Run
(System.Windows.Forms.ApplicationContext context) [0x00000] 
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm)
  at test.Program.Main () [0x00000]

Expected Results:

A Form with an empty ListView.

How often does this happen?

Every single time.

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