Wednesday, May 16, 2012

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.

        <input name="checkedRecords" type="checkbox" value="@item.AnyValue" title="checkedRecords" 
                        @if (item.MyCheckPost)
               .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.


No comments:

Post a Comment