我有一个设置为特定datasource的infragistics ultraCombo。我希望预先选择这些值中的一个,这样用户就不必选择它(大多数时候它将是预先选择的值)。但是,当我将ultraCombo设置为该值时,它会将下拉列表修改为仅包含该单个值!
我尝试过使用ultraCombo.value方法、ultraCombo.textbox.text方法等,它们的行为都是一样的。当我查看调试器时,完整的列表似乎存在,只是没有显示。如何在不破坏下拉列表的情况下预选列表中的值?
发布于 2009-02-03 15:49:49
最后使用下面的代码让它正常工作:
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发布于 2009-02-02 14:24:58
在数据绑定过程中,您不会仅仅使用Infragistics的方法来获取/设置所选值/索引吗
即ultracombo.selectedvalue = "My Value"
或ultracombo.selectedindex = 1
编辑:我在谷歌上搜索了一下,在他们的支持论坛上找到了一个主题,似乎是有人在问同样的问题。他们说要选择一个答案,只需设置.Value属性,所以我认为它可能是类似于ultracombo.value = 1的东西
这里是更多full support thread的链接。
发布于 2012-06-18 16:20:50
这就是如何设置Infragistics ComboBox的值
ultracombo.value=1https://stackoverflow.com/questions/503339
复制相似问题