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

Ajax Binding Checkbox Bound Field

1 Answer 32 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jennifer
Top achievements
Rank 1
Jennifer asked on 28 Apr 2011, 11:17 PM
Hi,

Here is my grid:

 @( Html.Telerik().Grid(Model)
            .Name("PatronGrid")
            .DataBinding(d => d.Ajax().Select("_AjaxBinding", "Home"))
                   .Columns(columns =>
                   {
                       columns.Add(p => p.ID)
                           .Format(Html.ActionLink("Select", "Detail",new { Id = "{0}" }, null).ToString())
                           .Encoded(false)
                           .Title("Select");
                       columns.Bound(p => p.LastName);
                       
                       columns.Bound(p => p.Active)
                            .ClientTemplate("<input type='checkbox' name='chkActive' value='<#= Active #>' />")
                            .Title("Active")
                            .Width(50)
                            .HtmlAttributes(new { style = "text-align:center" });

                                                 
                       columns.Bound(p => p.Active);
                                           
                       columns.Bound(p => p.CreatedDate).Format("{0:MM/dd/yyyy}")
                            .HtmlAttributes(new { style = "text-align:center;" });
                       
                   })
            .Pageable(pager => pager.PageSize(5))
            .Sortable()
            .NoRecordsTemplate("<p style='padding:10px'>Enter an Account or Name to search by, leave blank to display all records.")
        )

The ACTIVE data element is defined as a BOOLEAN.

My Question:

When I initially load the page everything looks nice. When I sort the grid or page it, the checkbox disappears and the words "false" and "true" appear instead in only the BOUND column ( columns.Bound(p => p.Active). The TemplateColumn does not do this. Just wondered why - its been driving me crazy for several days. I have your MVC3 Telerik.Web.MVC.dll dated 4/14/2011

Thanks so much..

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 29 Apr 2011, 08:12 AM
Hello Jennifer,

 You can check this help article which explains the behavior you are getting.

All the best,
Atanas Korchev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Jennifer
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or