开发者

Linking multiple ListBoxes to only allow single select

I have three ListBoxes each representing a single field database table. They are presented side by side on the ASP.NET page. Is there any way to group them so that only a single item from any of the boxes can be selected at a time?

edit - ie, if item开发者_如何学JAVA 3 in box 1 is selected, selecting any item in box 2 must unselect it


I would add an event to each of their SelectedIndexChanged events which resets the index of the other two controls to -1.

More to the point, it sounds like the interface you're creating is a tad awkward, or non-intuitive at the very least. Why are you presenting this as three lists? Do you feel it's going to be necessary to preface these controls with a lengthy explanation? (A UI "smell" to be sure!) Would it make more sense to combine them into one list? Would it make sense to have a set of three radio buttons (e.g., Animal, Vegetable, Mineral) which determine which of the three lists (Animals, Vegetables, Minerals) is displayed?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜