Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
260
UltraCombo or UltraComboEditor
posted

I have a datasource which has three columns, FirstName, MiddleName, LastName in  which I need to display these three fields into one Full Name.  I need the full name to display in the combobox.  This object also has a value member property that is a name id which needs to be set to the valuemember of the combo box.  I can get one or the other to happen, but not both.  I can combine the columns in a loop and bind the combobox to a List, which does not have the valuemember or I can have only one name, either first middle or last with the valuemember set.

Can anyone help?

Parents
  • 45049
    Suggested Answer
    posted

    I suggest using WinCombo for this approach, because it can contain multiple columns of data for each item in your list.

    Add a new, unbound column to the WinCombo to represent your "full name" column.  In the InitializeRow event of the combo, concatenate the FirstName, MiddleName, and LastName fields as desired and place the result in the cell belonging to your "full name" column.  You can then use that "full name" column as the DisplayMember of the control.  Your ID column would continue to be the ValueMember of the control.

    If you don't want to display the full name column, you can hide it.  Alternately, you could hide the other three columns instead, depending on what result you want.

Reply Children