niao
niao

Reputation: 5070

listbox with checkboxes

Greetings, in my asp.net mvc application I have a listbox rendered as follows:

<%= Html.ListBox("localization", (Model as SeekWeb.Models.CreateMessageViewModel).Localizations.AsEnumerable())%>

is there any way to have checkbox for each listbox item? if checkbox is checked then the appropriate listbox item is selected.

Upvotes: 1

Views: 6671

Answers (2)

ten5peed
ten5peed

Reputation: 15890

I use a funky little jQuery plugin - jQuery Multiselect - to turn listboxes into more user friendly checkboxes. It's themeroller ready too!

Yeah, it does rely on the user having JS enabled but it does degrade gracefully to the standard listbox.

HTHs,
Charles

Upvotes: 10

Mac
Mac

Reputation: 2342

Checkboxes aren't part of the standard listbox. If you need checkboxes you'll probably need to use a grid of some kind. MVCContrib has a grid control that's pretty good.

Upvotes: 0

Related Questions