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
705
Combobox Displaying Entire Dataset Instead of Just Display Member
posted

 

Am I doing something wrong, in a normal combobox this works fine.  However in the ultracombobox it displays the entire dataset reguardless of 

DataSet ds1 = SqlHelper.ExecuteDataset(SqlConnection.String, CommandType.Text, "Exec dbo.procSecurityListSelect 'code'");
ultraComboSecId.DataSource = ds1.Tables[0];
ultraComboSecId.DisplayMember = "code";
ultraComboSecId.Value = "sec_id";

Parents
No Data
Reply
  • 20
    posted

    Hi,

    this took a while to solve, but now seems not only logical but obvious

     

     

    uCbo.DataSource = ds1.Tables[0]

    uCbo.DropDownStyle = Infragistics.Win.UltraWinGrid.UltraComboStyle.DropDownList

    uCbo.DisplayMember = "code"

    uCbo.ValueMember = "sec_id"

    ' now we hide the columns that we dont wish to see

    uCbo.Rows.Band.Columns(1).Hidden = True

    ' now lets hide the column headers

    uCbo.Rows.Band.ColHeadersVisible = False

     ' and finally we set the width of the remaining column to the width of the control

    uCbo.Rows.Band.Columns(0).Width = uCbo.Width

     

     

    Hope this helps

    regards

     

    Andy (Dogs)

Children