I suggest you ...

better binding support for checkbox lists!

binding checkboxes is still a pain. I'd like to be able to bind a control to an IEnumerable of items and not worry about it anymore.

651 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    anonymousanonymous shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    10 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • nanda kumarnanda kumar commented  ·   ·  Flag as inappropriate

        I am 100% agree with you. I am binding child objects to UI. the name of the check boxes are "JobOrder[0].JobOrderDeliverables[0].JobOrderDelivTranscript[0].TranscriptType.id" and JobOrder[0].JobOrderDeliverables[0].JobOrderDelivTranscript[1].TranscriptType.id

        in case i am not checking the first check box, nothing will be transferred to the controller. because index zero is missing in the name. Now i am doing some workarounds like i am re-arranging the name of the checked checkbox when i am submitting the form. I am looking for the better data-bind from mvc4

      • PeterPeter commented  ·   ·  Flag as inappropriate

        And also for radio button list. I know you can do it by "hand" it just feels dirty to call helpers for everything and then start "hacking" around with IDs and names.

      • DmitryDmitry commented  ·   ·  Flag as inappropriate

        Html.DropDownListFor(m => m.SelectedProperty, Model.SelectList) helper ignores the selected value of the SelectList. This should also be fixed.

      • MemeDeveloperMemeDeveloper commented  ·   ·  Flag as inappropriate

        Is this really such a pain? Can't believe this is so popular? Why not go back to asp.net webforms :) for the game changing timesaving power of such beauties as <asp:CheckBoxList ? Or just take 20 mins to roll your own?

      • Andreas KrollAndreas Kroll commented  ·   ·  Flag as inappropriate

        Have a look at knockout.js
        You can have your data as viewmodel on the client and even have the option to iterate over arrays using jQuery templates to create the html code from the datamodel.

        I think I saw a sample of that on the knockout.js homepage.

      Feedback and Knowledge Base