下拉列表未正确显示新值 [英] Dropdownlist not displaying new value correctly

查看:74
本文介绍了下拉列表未正确显示新值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在数组中有一个DropdownBox.
而且我有一个循环.

当我循环时,循环(lol)我希望显示一个新值,
但是它显示了新值附加到旧值上.

例如,我的第一个值是"me",那么当它循环时,值是"you"
但它显示我"

循环中的代码:

I have a DropdownBox in an array.
And I have a loop.

When my loop, loops(lol) I wish to display a new value,
But it shows the new value appended to the old one.

For Example my first value is "me" then when it loops the value is "you"
but the it displays "me you"

The Code in the loop:

AreaArray(i).Items.Clear()
AreaArray(i).SelectedText = " "
AreaArray(i).SelectedText = MainDataTable(row)(2).ToString

推荐答案

我认为您误解了SelectedText属性的作用.

我认为您需要查看SelectedItem或SelectedIndex或SelectedValue属性来设置新选择,具体取决于您的实现.
I think you are misunderstanding what the SelectedText property does.

I think you need to be looking at the SelectedItem or SelectedIndex or SelectedValue properties to set the new selection, depending on your implementation.


这篇关于下拉列表未正确显示新值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆