DmitryEfimenko / TwitterBootstrapMvc

Fluent implementation of ASP.NET-MVC HTML helpers for Twitter Bootstrap.
Apache License 2.0
224 stars 79 forks source link

RadioButtonListFor. Can not make radio buttons disabled. #446

Closed markusgud closed 7 years ago

markusgud commented 7 years ago

I am trying to make all radio buttons disabled and I tried the following code which works OK for CheckBoxListFor:

var rbl = f.FormGroup().RadioButtonListFor(m => m.Value, Model.ListItems, item => item.Value, item => item.Text).ShowValidationMessage(true);

if (!string.IsNullOrEmpty(Model.Value))
{
    rbl = rbl.SelectedValues(items => items.Value==Model.Value);
    rbl = rbl.DisabledValues(items => true); // set all as disabled
}

Could this be a bug?

DmitryEfimenko commented 7 years ago

Indeed it was a bug. Fixed it. Please get latest.

markusgud commented 7 years ago

Excellent, works well now. Thank you for your quick reaction :-)