Skip to content

Infragistics Community Forum / Desktop / Ultimate UI for Windows Forms / Setting UltraCombo.Value does not select corresponding item

Setting UltraCombo.Value does not select corresponding item

New Discussion
Damian
Damian asked on Feb 3, 2009 3:48 PM

I have an UltraCombo bound to a datasource.

In my code I go combo.value = 3 but the row that has the id of 3 isn’t selected/displayed.

There is definitely a row with an id of 3 in the dropdown because if I select the row and debug it I can see that the value is 3.

Any ideas?

 

Sign In to post a reply

Replies

  • 0
    Damian
    Damian answered on Aug 11, 2008 9:12 PM

     To clarify the behavior I have the

    dropdownstyle = dropdownlist
    limittolist = true

    In the debugger if I set the value to 306. The Text says ENZN which is the correct value, but it doesn't go ahead and select the row, so the dropdown still shows the null value. If I click on the dropdown it opens and ENZN is the first item, i.e it's scrolled to the correct spot in the list. But it just doesn't show it when the dropdown is in the closed state.

    • 0
      Mike Saltzman
      Mike Saltzman answered on Aug 12, 2008 2:45 PM

      I'm afraid I am not following you. If the text is showing the correct test, then what exactly is "shows the null value?" Do you mean you are checking the selected row in code and it's nt the right one? 

      What version of the controls are you using? 

      • 0
        Damian
        Damian answered on Aug 12, 2008 2:53 PM

        If I stopped the code with the debugger, and popped 306 into the value field (via the debugger) then the text property would change correctly (again in the debugger). However the text wasn't being displayed in the actual control on the form. The control itself would just show null. I deleted the control from the form and added it back in with the same code and everythign worked as expected. I beat my head on this for days though so would love to know what was going on.

      • 0
        Mike Saltzman
        Mike Saltzman answered on Aug 13, 2008 2:40 PM

         I'm afraid I have no explanation for that. Maybe there was some property setting on the original control that is no longer set on the new one. 

      • 0
        Damian
        Damian answered on Aug 13, 2008 2:43 PM

        Yeah, really weird. Certainly wasn't any property I could spot.

      • 0
        shivangi
        shivangi answered on Sep 19, 2008 3:31 PM

        I am having a similar problem. I want to change the value of ultracombo according to a click on ultrawingrid.

        The default value of my ultracombo is NULL so it is not showing anything initially and when u click on it u can see the list. When something is selected from the list it is shown in the combobox. Now I want to change this value according to a value selected on the ultrawingrid.

        If I use ultracombo.value property , it sets the value to the selected value on the ultrawingrid, but that is not shown in the ultracombo.

        It might be something with changing Datamember or DisplayMember property!!!

        Your help is appreciated,

        Thanks

        Shivangi

      • 0
        shivangi
        shivangi answered on Sep 19, 2008 3:46 PM

        My ultracombo is a multi column combobox and column(0) is my displaymember

         

      • 0
        shivangi
        shivangi answered on Sep 19, 2008 6:34 PM

        I could resolve it by using the TEXT property 🙂

      • 0
        Jeff Staddon
        Jeff Staddon answered on Jan 30, 2009 9:03 PM

        I'm running into a wierd senario.  When I set the text property it works–but it also clears all the values out of the drop-down list.  Seems I can either set the value, or have a drop-down list but not both. 🙁

      • 0
        shivangi
        shivangi answered on Feb 2, 2009 2:22 PM

        Only problem I can think of is that the Text property you are setting is not part of drop-down list. Just make sure that you choose something out of dropdown list for Text property.

      • 0
        Jeff Staddon
        Jeff Staddon answered on Feb 2, 2009 3:57 PM

        Makes sense.  What method would I use to set it?

      • 0
        Jeff Staddon
        Jeff Staddon answered on Feb 3, 2009 3:48 PM

        Finally got it to work using the following code:

        Dim tempValue As String = myPreviousValue 'changes to the object loose the selected row–save it off and restore later

        MyUltraCombo.DataSource = queryDS.Tables(0) 'load the new data

        'Restore the previous selection 
        If tempValue <> "" Then
            For Each row As Infragistics.Win.UltraWinGrid.UltraGridRow In MyUltraCombo.Rows
                If row.Cells(0).Value.ToString = tempValue Then
                    MyUltraCombo.SelectedRow = row
                End If
            Next
        End If

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Damian
Favorites
0
Replies
12
Created On
Feb 03, 2009
Last Post
17 years ago

Suggested Discussions

Tags

Created by

Created on

Feb 3, 2009 3:48 PM

Last activity on

Feb 23, 2026 3:11 PM