databind checkedlistbox to arraylist
-
Can someone provide some sample code on how to bind to a checkedlistbox to an arraylist? My situation is I have a checklistbox on a form and a method that returns an arralylist in another class. How can I bind the arraylist in one class to the checkboxlist form in another class?
-
Can someone provide some sample code on how to bind to a checkedlistbox to an arraylist? My situation is I have a checklistbox on a form and a method that returns an arralylist in another class. How can I bind the arraylist in one class to the checkboxlist form in another class?
To be honest, i'm a bit surprised that CheckedListbox doesn't expose DataSource and others. I'm sure there's a better answer, but at the least you can use it's base class' methods: ArrayList list = new ArrayList(); list.Add("Hello"); ListBox box = (ListBox)checkedListBox1; box.DataSource = list;