views:

1521

answers:

3

I have an ingragistics 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 dropdown 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 dropdown list?

A: 

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
thats the problem--there doesn't seem to be methods to do this...
Jeff
A: 

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
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
A: 

Thanks for help.

http://TechZed.com

rahul