Hey guys, how can I bind the combo to a List<T>
if I add the columns manually to the WinCombo and then set the datasource to the list, it will ignore the columns I added and display all the properties of the list as columns.
I thought I could use the UltraDataSource but I couldn't figure out how to populate it since the following is not possible:
ultraDataSource1.DataSource = List
so far this is what I'm doing:
foreach (ValidvaluesBO vvl in vvlList){ ultraDataSource1.Rows.Add(new object[{vvl.Code , vvl.Name} ); }
combo.DataSource = ultraDataSource1 ;
but I was wondering if there is some other way of doing this.
any ideas?
thanks !
I don't understand what you are asking here, then. You started off by saying that you want to hide some columns at design-time. So I suggested you do it at run-time and pointed you to a KB article that shows how to do it at design-time. But now you are saying you don't know the layout at design-time. If you don't know the layout, how can you hide the columns?
Thanks for your reply.
Mike Saltzman"]The easiest thing to do is set the DataSource and then use the InitializeLayout event
Are there other solutions ?
I kind of like the idea of hiding unnecessary columns, so there is no way to programmatically define the columns huh?
Mike Saltzman"] If you want to set up the layout at Design-time
I don't know the layout at design time.
Hi,
The easiest thing to do is set the DataSource and then use the InitializeLayout event of the combo to hide the columns you do not want to see.
If you want to set up the layout at Design-time, before you bind, then you have to do this the same way you would in the grid. Here's a KB article that explains how:
HOWTO:How can I define columns in the grid at Design-time and bind them at run-time so that some fields of the data are excluded from the grid?