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
210
set value of ultraCombo dropdownlist style
posted

How do i set the value for ultraCombo dropdownlist when i know the value memeber.

  ui_sourceDescription.Value = value; works but if the value is not in the list, then nothing shoudl be selected.

Parents
  • 210
    posted

     I am currently using this.

     

    ui_exemptDescription.SelectedRow = GetSelectedRow(ui_exemptDescription,value);

     

     

            private UltraGridRow GetSelectedRow(UltraCombo combo, string value)
            {
                UltraGridRow selectedRow = null;

                foreach (UltraGridRow row in combo.Rows)
                {              
                    if (row.Cells[combo.ValueMember].Value.ToString() == value)
                    {
                        selectedRow = row;
                        break;
                    }
                }
                return selectedRow;
            }

     

     

    I hope there is a better way.. 

Reply Children