I have a grid in which one of the columns I would like to display/edit using RadioButtons. The underlying value is an enum. I'm still working on getting the column to display the correct choice. Right now, none of the radio buttons are checked. What am I doing wrong? Below please see the grid, and the enum declaration (in case that's an issue)
@(Html.Kendo().Grid<
HVMS.BusinessLayer.Models.Metric
>()
.Name("MetricGrid")
.Columns(columns =>
{
columns.Bound(c => c.Name);
columns.Bound(c => c.ThresholdAssignment).ClientTemplate(
"<
span
>Unassigned</
span
> <
input
type
=
'radio'
name
=
'Metrics[#= index(data)#].ThresholdAssignment'
# if (ThresholdAssignment == 'Unassigned') { #
checked
=
'checked'
# } # />" +
" <
span
>Weekly</
span
> <
input
type
=
'radio'
name
=
'Metrics[#= index(data)#].ThresholdAssignment'
# if (ThresholdAssignment == 'Weekly') { #
checked
=
'checked'
# } # />" +
" <
span
>Monthly</
span
> <
input
type
=
'radio'
name
=
'Metrics[#= index(data)#].ThresholdAssignment'
# if (ThresholdAssignment == 'Monthly') { #
checked
=
'checked'
# } # />"
);
})
.ToolBar(toolbar =>
{
toolbar.Save();
toolbar.Excel();
toolbar.Pdf();
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Navigatable()
.Scrollable(s => s.Height("auto"))
.Selectable(selectable => selectable
.Mode(GridSelectionMode.Single)
.Type(GridSelectionType.Row))
.AutoBind(false)
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.Model(model => model.Id(p => p.Id))
.Read(read => read.Action("Metrics_Read", "MetricThreshold").Data("additionalData"))
.Update(update => update.Action("Metrics_Update", "MetricThreshold"))
)
)
public
enum
ThresholdAssignment { Unassigned, Weekly, Monthly }