How to Bind a checkbox with Boolean value in the Telerik MVC3 grid

Spend hours to find the solution but when i checked the Telerik forum got it simply. Here is the code

Actully we use ClientTemplate and  checkbox inside it with databound to boolean.


 columns.Template(
               @<text>
        <input name="checkedRecords" type="checkbox" value="@item.AnyValue" title="checkedRecords" 
                        @if (item.MyCheckPost)
                        {
                            <text>checked="checked"</text>
                            <text>disabled="disabled"</text>
                        }
                    />
        </text>)
               .Title("").Width(36).HtmlAttributes(new { style = "text-align:center" });

Here item.MyCheckPost is True or False.

Simply modify it accordingly and use in your code.

Thanks

Comments

Popular Posts

GREYCstoration Oil Paint plugin for Photoshop

Service Bus Gateway service stuck at Starting

PowerApps SubmitForm not clearing People Picker value

Apple iPhone sending SMS automatically 00447786205094

SharePoint online hub navigation not updating for other users