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

[Solved] using Html.CheckBoxFor for Template Column

0 Answers 98 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.
mian
Top achievements
Rank 1
mian asked on 20 Sep 2011, 04:31 PM
Hi, 

I have bound my view to my model, model inside contains a list, I have to bound that list to radGrid. fine so for. 
now there is a bool field inside that list, I want to take a checkBox column for that. I want to show the check box checked if list contains true for the bool value. for that I am trying checkBoxFor() method. but 

@(Html.Telerik().Grid(Model.ACLGridModel.Data)
                    .Name("ACL-Grid")
                    .DataBinding(dataBinding => dataBinding.Ajax().Select("Index", "Role"))
       .EnableCustomBinding(true)
                    .Pageable(settings => settings.Total(Model.UserActionsGridModel.Total).PageSize(10).Style(GridPagerStyles.PageSizeDropDown | GridPagerStyles.NextPreviousAndNumeric))
   
       .Columns(columns =>
{
columns.Bound(x => x.userActionName);
                          
                            columns.Bound(x=>x.Allow)
                           .Template(@Html.CheckBoxFor(x=>x.Allow)                                                                                                           
                   })

but here x.Allow does not work , as inside x pints to the model , not to the list inside of model .. 
what can I do ? plz help 
Tags
Grid
Asked by
mian
Top achievements
Rank 1
Share this question
or