Infragistics UltraCombo 上的预设值

发布于 2024-07-13 00:04:08 字数 335 浏览 8 评论 0原文

我有一个 infragistics ultraCombo,我将其设置为特定的数据源。 我想预先选择这些值之一,这样用户就不必选择它(大多数情况下它将是预先选择的值)。 但是,当我将 ultraCombo 设置为该值时,它会将下拉列表修改为仅包含该单个值!

我尝试过使用 ultraCombo.value 方法、ultraCombo.textbox.text 方法等,它们的行为方式都相同。 当我查看调试器时,完整列表似乎存在,只是没有显示。 如何在不破坏下拉列表的情况下预先选择列表中的值?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

━╋う一瞬間旳綻放 2024-07-20 00:04:08

最后使用以下代码让它工作:

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

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
分開簡單 2024-07-20 00:04:08

在数据绑定期间,您是否只使用 Infragistics 的方法来获取/设置所选值/索引

,即 ultracombo.selectedvalue = "My Value"

或 ultracombo.selectedindex = 1

编辑:我做了一些谷歌搜索,在他们的支持论坛上发现了一个主题,似乎有人在问同样的事情。 他们在那里说,要选择一个答案,您只需设置 .Value 属性,所以我想象它可能类似于 ultracombo.value = 1

这里是更多 < a href="http://forums.infragistics.com/forums/t/1048.aspx" rel="nofollow noreferrer">完整支持线程。

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.

淑女气质 2024-07-20 00:04:08

这是设置 Infragistics ComboBox 值的方法:

ultracombo.value=1

This is how you set the value of Infragistics ComboBox:

ultracombo.value=1
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文