Please do not reply to this email- if you want to comment on the bug, go to the URL shown below and enter your comments there.
Changed by [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=82069 --- shadow/82069 2007-07-11 10:53:08.000000000 -0400 +++ shadow/82069.tmp.20729 2007-07-11 10:53:08.000000000 -0400 @@ -0,0 +1,80 @@ +Bug#: 82069 +Product: Mono: Class Libraries +Version: 1.2 +OS: +OS Details: +Status: NEW +Resolution: +Severity: +Priority: Normal +Component: Windows.Forms +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: ValueMember/DisplayMember at ComboBox with Dictionary don't work + +Description of Problem: +In a ComboBox the properties ValueMember and DisplayMember don't works fine. +In the comboBox Text property show me the result of ToString() and is not +considering the sets of DisplayMember/ValueMember properties. +The above code fails in the Assert. + + +Steps to reproduce the problem: +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using NUnit.Framework; + +namespace Mono.Sms +{ + internal static class Program + { + private static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new form()); + } + } + + public class form : Form + { + private ComboBox combo = new ComboBox(); + + public form() + { + Dictionary<string, string> dict = new +Dictionary<string,string>(); + + dict.Add("key1","value1"); + dict.Add("key2","value2"); + + foreach (KeyValuePair<string, string> pair in dict) + { + combo.Items.Add(pair); + } + + combo.ValueMember = "Value"; + combo.DisplayMember = "Key"; + + this.Controls.Add(combo); + + combo.SelectedIndex = 0; + + Assert.AreEqual(combo.Text, "key1"); + } + } +} + +Actual Results: +The Text property get with string value "[key1, value1]", the ToString() value. + +Expected Results: +It's extected the value "key1" in the ComboBox Text property. + +How often does this happen? +Always. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
