开发者

Linking multiple ListBoxes to only allow single select

开发者 https://www.devze.com 2023-02-13 05:09 出处:网络
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 b

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

精彩评论

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