DataBind ArrayList with Struct
-
Please someone look up my code. I want to bind ArrayList to combobox. private class stru { public string ID; public string Name; public stru( string id, string name ) { ID = id; Name = name; } } ... ArrayList a = new ArrayList(); a.Add(new stru("1","Zach")); a.Add(new stru("2","Amin")); comboBox2.DataSource = a; comboBox2.DisplayMember = "Name"; Thank You. Sudeep ====== You need a head to program. Cool, fast and sharp.
-
Please someone look up my code. I want to bind ArrayList to combobox. private class stru { public string ID; public string Name; public stru( string id, string name ) { ID = id; Name = name; } } ... ArrayList a = new ArrayList(); a.Add(new stru("1","Zach")); a.Add(new stru("2","Amin")); comboBox2.DataSource = a; comboBox2.DisplayMember = "Name"; Thank You. Sudeep ====== You need a head to program. Cool, fast and sharp.
Are you getting an exception? Do you have a comboBox2.DataBind() anywhere in there?