2

I have an infragistics ultraCombo that I set to a specific datasource. I want to pre-select one of those values so the user doesn't have to choose it (most of the time it will be the pre-selected value). However, when I set the ultraCombo to that value it modifies the drop-down list to contain only that single value!

I've tried using the ultraCombo.value method, the ultraCombo.textbox.text method, etc, and they all behave the same way. When I look in the debugger the full list appears to be present, just not displayed. How do I pre-select a value in the list without destroying my drop-down list?

Jean-François Corbett
  • 37,420
  • 30
  • 139
  • 188
Jeff
  • 8,020
  • 34
  • 99
  • 157

3 Answers3

1

This is how you set the value of Infragistics ComboBox:

ultracombo.value=1
Victor Zakharov
  • 25,801
  • 18
  • 85
  • 151
1

During databind, wouldn't you just use whatever Infragistics's method is for getting/setting the selected value/index

i.e. ultracombo.selectedvalue = "My Value"

or ultracombo.selectedindex = 1

Edit: I did a little google searching and found a topic on their support forum of what appears to be someone asking near the same thing. They are saying there that to select an answer you would just set the .Value property, so I am imagining it might be something along the lines of ultracombo.value = 1

Here is the link for more the full support thread.

TheTXI
  • 37,429
  • 10
  • 86
  • 110
1

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
Jeff
  • 8,020
  • 34
  • 99
  • 157
  • Jeff, take a look at my edited post to see if that method might work better for you. It looks like someone else was having the same issue you were. – TheTXI Feb 03 '09 at 15:59