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

[Solved] Send more complex ViewModel object to View (for Telerik Grid)

1 Answer 118 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David
Top achievements
Rank 1
David asked on 07 Oct 2010, 06:37 AM
How to send a more complex view model to a telerik grid?

The following works when I just send an IENumerable<List>...
<%
        
        Html.Telerik().Grid(Model)
            .Name("Lists")
            .DataBinding(dataBinding => dataBinding
                        .Ajax()
                        .Select("_ShowLists", "Admin")
            )
            .Columns(c =>
                         {
                             c.Bound(q => q.Lists).Title("List Types");
                         })
            .Pageable()
            .Sortable()
            .Selectable()
            .Render();
            
    %>

But I also want to send some other things, so I created TelerikViewModel, which has my IENumerable<List> and other variables.

But then I keep getting following error, what is wrong?

Compiler Error Message: CS0411: The type arguments for method 'Telerik.Web.Mvc.UI.ViewComponentFactory.Grid<T>(System.Collections.Generic.IEnumerable<T>)' cannot be inferred from the usage. Try specifying the type arguments explicitly.

Source Error:

Line 11:     <%
Line 12:         
Line 13:         Html.Telerik().Grid(Model)

...

1 Answer, 1 is accepted

Sort by
0
Conrad
Top achievements
Rank 1
answered on 19 Oct 2010, 12:35 PM
Hi David I have the same problem, did you find a solution?

Tags
General Discussions
Asked by
David
Top achievements
Rank 1
Answers by
Conrad
Top achievements
Rank 1
Share this question
or