I know this might be a juvinile question, but this is my first experince with C# and UI (both).
Question is: I have a datasource with 12 columns, but want to populate just three columns from the datasource. Have tried adding three columns and setting the "Key" to match the DataSource.Column name. but still see 12 columns
Hi,
UltraCombo (or UltraGrid or UltraDropDown) will always create all of the columns in the data source. There's no way around this - except to modify the data source or use a copy that only includes the columns you want.
What you can do is hide the columns you don't want the user to see. The best place to do this is in the InitializeLayout event of the control. You just set Hidden to true on the columns you want to hide.
Thanks for quick reply,
The problem is today the datasource is 12 it can grow also so hiding wil become a problem. Can I add items in the combobox? somthing like
Combobox.additem();
What does it matter if you add new columns? If your code is in the InitializeLayout event of the Combo, you can hide all columns except the ones you want the user to see. So adding new columns later is not a problem.
There is no AddItem method on UltraCombo, it's data comes from the data source. So if you wanted to add data to it, you would need to add them to the data source it is bound to.
UltraComboEditor allows you to add items to the list without a data source, but this control is like the MS Combo in that it only displays a single list, there are no columns.