[Mono-bugs] [Bug 543773] ListView TopItem {set} broken

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Oct 25 10:27:08 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=543773

User calberto.cortez at gmail.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=543773#c8





--- Comment #8 from Carlos Alberto Cortez <calberto.cortez at gmail.com>  2009-10-25 08:27:03 MDT ---
A big problem about filling bugs without test case is this: we go, and fix it,
but sometimes we are missing some specific scenario. I'm trying this property
with this sample:

using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

public class Test
{
        static void Main (string [] args)
        {
                Application.EnableVisualStyles ();
                TestForm form = new TestForm ();
                Application.Run (form);
        }

}

public class TestForm : Form
{
        ListView lv;
        Button b;

        ListViewItem [] items;
        ListViewItem saved_item;

        public TestForm ()
        {
                items = new ListViewItem [200];
                for (int i = 0; i < items.Length; i++)
                        items [i] = new ListViewItem ("Item " + i);

                lv = new ListView ();
                lv.Size = new Size (300, 310);
                lv.BeginUpdate ();
                lv.Columns.Add ("One");
                lv.Columns.Add ("Two");
                lv.Items.AddRange (items);
                lv.View = View.Details;
                lv.EndUpdate ();

                b = new Button ();
                b.Location = new Point (5, lv.Bottom + 10);
                b.Text = "Test";
                b.Click += delegate
                {
                        saved_item = lv.TopItem;
                        Console.WriteLine ("Saving top item as " + saved_item);
                        lv.BeginUpdate ();
                        lv.Items.Clear ();
                        lv.Items.AddRange (items);
                        lv.EndUpdate ();
                        lv.TopItem = saved_item;
                };

                Controls.AddRange (new Control [] { lv, b });
                Size = new Size (320, 380);
        }
}

I'm also following your instructions. Is there a chance you could cook a test
case based on your application? Thanks!

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