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
639
Assign selected value for multi column UltraComboBox
posted

Hi all,

I have a ultracombobox which look like this (below) and the sr_function_hid will hide from user. How should I program and assign the selected row  based on the sr_function_hid value?

now if i direct assign ucbFunction.text = 148 (the value of sr_function_hid which148), it will only show the "148" in the dropdown, insteed of show "NSX_ATV".

Name Remark sr_function_hid
NSX_ATV Request ffrom A.. 148
NSX_Default Default Step Fun.. 143

Please guide.

Thank you very much !

Parents
  • 469350
    Verified Answer
    Offline posted

    Make sure your ValueMember and DisplayMember are set correctly. In this case, the ValueMember should point to sr_function_hid and the DisplayMember should be Name.

    The ValueMember property is linked to the control's Value property. So when you want to "select" something in code, you can either set the Value or the Text property of the control. But if you set the Text, you have to set it to something in the DisplayMember column, and if you set the Value, you should use a value in the ValueMember column.

    In this case, you want to set the combo.Value = 148

Reply Children
No Data