using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Web.Mvc; using Kendo.Mvc.UI; using Kendo.Mvc.UI.Fluent; namespace Kreta.Web.Helpers.Unhacked { public static class RadioButtonExtensions { public static List KendoRadioButtonsFor(this HtmlHelper html, Expression> expression, List options, Expression> idExpression, Expression> labelExpression) { var idMethod = idExpression.Compile(); var labelMethod = labelExpression.Compile(); var radioButtonBuilders = new List(); foreach (var option in options) { radioButtonBuilders.Add(html.Kendo().RadioButtonFor(expression).Label(labelMethod(option)).Value(idMethod(option))); } return radioButtonBuilders; } } }