[Mono-bugs] [Bug 424273] New: ListBox: ArgumentException in SelectedIndexChanged

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Sep 8 06:07:23 EDT 2008


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


           Summary: ListBox: ArgumentException in SelectedIndexChanged
           Product: Mono: Class Libraries
           Version: SVN
          Platform: x86
        OS/Version: Windows Vista
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: kobruleht2 at hot.ee
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


To reproduce:

1. Run code below
2. Click in listbox containing numbers
3. Press up or down arrow key

Observed:

Unhandled Exception: System.ArgumentException: parameters

  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x00000] 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[]
parameters) [0x00000] 
  at System.ComponentModel.ReflectionPropertyDescriptor.SetValue (System.Object
component, System.Object value) [0x00000] 


Code:

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;

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

class Paring
{
    public string Tekst { get; set; }
    public string Id { get; set; }
    public Paring()
    {
        Tekst = Id = DateTime.Now.ToString();
    }
}

class Kontekst
{
    public string Rquery { get; set; }
}

class ReportDialogForm : Form
{

    public ReportDialogForm()
    {
        tabControl1 = new TabControl();
        tabPage1 = new TabPage();
        reportListBox = new ListBox();
        tabControl1.Anchor = ((AnchorStyles)((((AnchorStyles.Top |
AnchorStyles.Bottom)
                                | AnchorStyles.Left)
                                | AnchorStyles.Right)));
        tabControl1.Controls.Add(tabPage1);
        tabControl1.Size = new System.Drawing.Size(591, 296);
        tabPage1.Controls.Add(reportListBox);
        tabPage1.Size = new System.Drawing.Size(583, 263);
        tabPage1.Layout += new LayoutEventHandler(tabPage1_Layout);
        reportListBox.Anchor = AnchorStyles.None;
        reportListBox.Size = new System.Drawing.Size(287, 384);
        reportListBox.TabIndex = 1000;
        ClientSize = new System.Drawing.Size(588, 292);
        Controls.Add(tabControl1);
        reportListBox.SelectedIndexChanged +=
reportListBox_SelectedIndexChanged;
        filterListBox = new ListBox();
        List<Paring> p = new List<Paring>();
        filterListBox.DataSource = p;
        filterListBox.DisplayMember = "tekst";
        filterListBox.ValueMember = "Id";
        var FilterBinding = new BindingSource();
        var Ko = new Kontekst();
        FilterBinding.DataSource = Ko;
        var b = filterListBox.DataBindings.Add("SelectedValue", FilterBinding,
"Rquery");
        b.DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;
        tabPage1.Controls.Add(filterListBox );
        for (int i = 0; i < 20; i++)
            reportListBox.Items.Add(i.ToString());
    }

    void reportListBox_SelectedIndexChanged(object sender, EventArgs e)
    {
        List<Paring> p = new List<Paring>();
        p.Add(new Paring());
        filterListBox.DataSource = p;
        filterListBox.DisplayMember = "tekst";
        filterListBox.ValueMember = "Id";
    }

    void tabPage1_Layout(object sender, LayoutEventArgs e)
    {
        int height = 100;
        reportListBox.Top = height;
        reportListBox.Height = tabPage1.Height - height;
        reportListBox.Width = tabPage1.Width / 2;
        reportListBox.Left = 0;
    }

    TabControl tabControl1;
    TabPage tabPage1;
    ListBox reportListBox, filterListBox;
}


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