开发者

How to bind enum options to DevExpress.RadioButtonList

开发者 https://www.devze.com 2023-02-10 17:23 出处:网络
Example code: 开发者_JS百科@Html.DevExpress().RadioButtonList(settings => { settings.Properties.DataSource = Enum.GetNames(typeof(SEICCV.Web.Models.eTipoControle));

Example code:

   开发者_JS百科@Html.DevExpress().RadioButtonList(settings => {
            settings.Properties.DataSource = Enum.GetNames(typeof(SEICCV.Web.Models.eTipoControle));
            settings.Name = "radio";
   }).GetHtml()


@(Html.DevExtreme().RadioGroupFor(m=>m.eTipoControleValue)
.DataSource(Html.GetEnumSelectList<SEICCV.Web.Models.eTipoControle>().Select(i => new { Value = short.Parse(i.Value), Text = i.Text.Value }))
                        .ValueExpr("Value")
                        .DisplayExpr("Text")
                        .Value(Model.eTipoControleValue)
                        .Layout(Orientation.Horizontal))
0

精彩评论

暂无评论...
验证码 换一张
取 消