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

User [email protected] added comment
https://bugzilla.novell.com/show_bug.cgi?id=476354#c1


Carlos Alberto Cortez <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]




--- Comment #1 from Carlos Alberto Cortez <[email protected]>  
2009-02-18 15:49:41 MST ---
I tried the next sample, based on your description:

using System;
using System.Windows.Forms;

public class Test
{
        static void Main ()
        {
                Application.Run (new TestForm ());
        }
}

public class TestForm : Form
{
        ListView lv;
        ListViewItem [] items_cache;

        public TestForm ()
        {
                lv = new ListView ();
                lv.VirtualMode = true;
                lv.RetrieveVirtualItem += RetrieveVirtualItemHandler;
                lv.Dock = DockStyle.Fill;
                lv.Columns.Add ("One");
                lv.Columns.Add ("Two");
                lv.View = View.Details;
                lv.FullRowSelect = true;

                lv.OwnerDraw = true;
                lv.DrawItem += DrawListViewItemHandler;
                lv.DrawColumnHeader += DrawListViewColumnHeaderHandler;

                lv.VirtualListSize = 17;
                lv.Parent = this;
                items_cache = new ListViewItem [lv.VirtualListSize];
        }

        void DrawListViewColumnHeaderHandler (object o,
DrawListViewColumnHeaderEventArgs args)
        {
                args.DrawDefault = true;
        }

        void DrawListViewItemHandler (object o, DrawListViewItemEventArgs args)
        {
                args.DrawDefault = true;
        }

        void RetrieveVirtualItemHandler (object o, RetrieveVirtualItemEventArgs
args)
        {
                if (items_cache [args.ItemIndex] == null) {
                        ListViewItem item = new ListViewItem ("Item " +
args.ItemIndex);
                        item.SubItems.Add ("Sub item " + args.ItemIndex +
"-1");
                        items_cache [args.ItemIndex] = item;
                }

                args.Item = items_cache [args.ItemIndex];
        }
}

And it doesn't throw any exception (that's why it's *important* that our users
provide their test case, so we know the exact way to reproduce the issue).

Also, I fixed a bug like this one some months ago. What version are you using?

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