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

[Solved] ToGridModel issue

2 Answers 57 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.
Matt
Top achievements
Rank 1
Matt asked on 24 Jan 2012, 09:15 PM
Hey guys,
I am trying to persist client side filters to my code that exports data to a csv file. I found several examples that utilize the 'ToGridModel' extension method including an entire sample project. Here is my code that utilizes it:

IEnumerable<EmployeeReferral> getAll = queue.ShowEmployeeReferralQueue(gfo).ToGridModel(page, 10, orderBy, filter).Data;

'ShowEmployeeReferralQueue' returns an IQueryable. The problem is that this won't even compile. I'm getting an error that says 'No overload for method 'ToGridModel' takes 4 arguments'.
The data types in the parameters are int,int, string, string so it should work. Any ideas?
Thanks,
mdk

P.S. Yes, I do have 'using Telerik.Web.Mvc.Extensions;' in place.

2 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 25 Jan 2012, 08:49 AM
Hello Matt,

I suppose that the best overload which fits your scenario requires 5 arguments. In your statement you miss the groupBy argument which is string:

.ToGridModel(page, 10, orderBy, groupBy, filter) 


All the best,
Petur Subev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
gabriele
Top achievements
Rank 1
answered on 03 Sep 2012, 05:31 PM
I have this problem with .ToGridModel():
whene i try to use
GridModel gmRow2 = queryableRow.ToGridModel(gs.Page, gs.Size, gs.OrderBy, gs.GroupBy, gs.Filter); (where gs=GridState)
I recive this error:Provided expression should have string type Parameter name: stringExpression

Any ideas???
Tags
Grid
Asked by
Matt
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
gabriele
Top achievements
Rank 1
Share this question
or