This is a migrated thread and some comments may be shown as answers.

RadioButtonFor not checked on load kendo grid popup editor

2 Answers 494 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sindhura
Top achievements
Rank 1
Sindhura asked on 18 Aug 2015, 11:10 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Radoslav
Telerik team
answered on 20 Aug 2015, 07:32 AM
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
0
Sindhura
Top achievements
Rank 1
answered on 20 Aug 2015, 05:30 PM
Perfect. Thanks Radoslav. 
Tags
Grid
Asked by
Sindhura
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Sindhura
Top achievements
Rank 1
Share this question
or