Take the 2-minute tour ×

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 3 in box 1 is selected, selecting any item in box 2 must unselect it

share|improve this question
When you say a "single field database table", do you mean a "single field IN a database table" or a table that contains only one field? –  Bob Kaufman Feb 25 '11 at 13:19
table that contains only one field (id, name). thanks for your answer, i need to think about this one. –  greendisease Feb 25 '11 at 14:20
that's two fields, albeit one's a "surrogate key" and the other's "the real data". I was envisioning a possibility of a second data field/foreign key that could be a cue as to which of the three lists the value belongs in. –  Bob Kaufman Feb 25 '11 at 15:50

1 Answer 1

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?

share|improve this answer
+1 for the UI-sugestion. Seems to me that it is a much better way to approach this. –  Koen Feb 25 '11 at 14:42

Your Answer


