Hi all,
I have a DataTable (named dt) with data inside. I need to create a runtime CheckBox and assign that DataTable as ComboBox.DataSource. Here's some code:
With ComboBox drawn at design time (and without creating a new one) the code works fine. But if I don't use a design time ComboBox and create a new one from scratch (like the code above) doesn't work.Code:Dim cmb as New ComboBox() cmb.DisplayMember = "desc" cmb.ValueMember = "id" cmb.DataSource = dt
I also tried to force the creation of the control by calling the .CreateControl() method or forcing the creation of the handle by getting it withThe result is ALWAYS a ComboBox with ZERO Items.Code:Dim p As IntPtr = ComboBox.Handle;
Any help is appreciated.
Thanks,
Xmas.


Reply With Quote