Infragistics UltraCombo 上的预设值
我有一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
最后使用以下代码让它工作:
Finally got it to work using the following code:
在数据绑定期间,您是否只使用 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.
这是设置
Infragistics ComboBox
值的方法:This is how you set the value of
Infragistics ComboBox
: