Hi there,
I have an UC that displays two columns from a query.
Question is, how can I have it to use both columns as the selected value?
I mean, to display once selected from the dropdown list, ie Name and Age, separated by a space ?
Thanks in advance!
Hi,
The UltraCombo determines which field on the list to use for it's data and display values by looking at the DataMember and DisplayMember properties, respectively. You can only specify one column for each of these.
So if you want the display or value to be the combination of two columns, then you need to create an additional column on the list that contains the combined value. This is pretty easy to do. What you would do is handle the InitializeLayout event of the UltraCombo and add an unbound column. Then you use the InitializeRow event to populate that column's Value with the combination of values from the other columns in the same row. Then you just set the ValueMember or DisplayMember to point to the unbound column.
I know it's been a long time since this was closed but I struggling with this now.
It only lets me choose from the columns in the bindingsource. I can't choose an unbound column for the DisplayMember.
Am I missing something?
Mike,
Thanks for your clear answer, as usual a nice one!