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

[Solved] Cannot use column.Template

3 Answers 103 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.
Neo Geo
Top achievements
Rank 1
Neo Geo asked on 07 Apr 2010, 08:43 AM
I want display a boolean attribute as a checkbox on grid. When i use checkbox sample code in grid demo and build, i have an error: "Cannot implicitly convert type 'void' to 'object'  "  and mark at .Render();

Here my source code:
<%= Html.Telerik().Grid<DangKyHocPhan.Models.LopLyThuyet>(Model) 
                        .Name("DangKyHocPhan") 
                        .Columns(columns => 
                        { 
                            columns.Template(o => 
                            {                                 
                                %> 
                                    <input name="checkedRecords" type="checkbox" checked="checked"/>  
                                <
                            }).Title("Check").Width(50).HtmlAttributes(new { style = "text-align:center" }); 
 
                        }) 
                        .Render();               
                    %> 

I using VS 2008 SP1, ASP.NET MVC 1.0. In this code, i didn't use a boolean to check yet. I just tested sample code.

3 Answers, 1 is accepted

Sort by
0
IQworks
Top achievements
Rank 1
answered on 07 Apr 2010, 04:20 PM
Hi Neo,
     Not sure if this will solve your problem, but , it might give a good clue .... 
     http://idevelopdotnet.wordpress.com/2009/03/04/aspnet-mvc-renderpartial/ 
0
Neo Geo
Top achievements
Rank 1
answered on 07 Apr 2010, 06:34 PM
Thanks so much. I solved this problem by using another way.
0
IQworks
Top achievements
Rank 1
answered on 07 Apr 2010, 08:57 PM
Great !   Was it something in the coding ?
Tags
Grid
Asked by
Neo Geo
Top achievements
Rank 1
Answers by
IQworks
Top achievements
Rank 1
Neo Geo
Top achievements
Rank 1
Share this question
or