RadioButtonFor not checked on load kendo grid popup editor

3 posts, 1 answers
  1. Sindhura
    Sindhura avatar
    6 posts
    Member since:
    Apr 2014

    Posted 18 Aug 2015 Link to this post

    I have a kendogrid:

     @(Html.Kendo().Grid<OAIWebInterface.Models.Leadership>()
                                .Name("LeadershipGrid")
                                .Columns(columns =>
                                {
                                    columns.Bound(c => c.LeadershipID).Width(150);
                                    columns.Bound(c => c.Organization).Width(150);
                                    columns.Command(command => { command.Edit(); }).Width(95);
                                })
                                .Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("LeadershipEditorTemplate"))
                                .HtmlAttributes(new { style = "max-height: 350px;" })
                                .DataSource(dataSource => dataSource
                                    .Ajax()
                                    .Model(model => model.Id(p => p.LeadershipID))
                                    .Read(read => read.Action("Leadership_Read", "AnnualSummary", new { ASId = Model.AnnualSummaryID}))
                                    .Update(update => update.Action("LeadershipPopup_Update", "AnnualSummary"))
                                )
                            )​

     

    I have a Editor Template called "LeadershipEditorTemplate" in which I got the following code:

        @Html.RadioButtonFor(x => x.Reimburse, true)Yes
          @Html.RadioButtonFor(x => x.Reimburse, false)No

     

    On edit kendo row, one of the radio buttons in the editor template do not get checked. For example, Yes should be checked when the Reimburse value is true/1 and No should be checked when the value is set to false/0.

     I verified that Reimbuse has a value when in template, but can't make it work with radio buttons.

     I would appreciate any input on this issue.

    Thanks.

     

  2. Answer
    Radoslav
    Admin
    Radoslav avatar
    1566 posts

    Posted 20 Aug 2015 Link to this post

    Hi Sindhura,

    Thank you for contacting us.

    To achieve the desired functionality you need to change the radio buttons declaration as following:
    @Html.RadioButtonFor(x => x.Reimburse, "true")Yes
    @Html.RadioButtonFor(x => x.Reimburse, "false")No

    Additionally I am sending you a simple example which demonstrates the desire functionality.

    If you need further assistance, do not hesitate to contact us again.

    Regards,
    Radoslav
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Sindhura
    Sindhura avatar
    6 posts
    Member since:
    Apr 2014

    Posted 20 Aug 2015 in reply to Radoslav Link to this post

    Perfect. Thanks Radoslav. 
Back to Top