This is a migrated thread and some comments may be shown as answers.
Custom binding with GridCommand and ToGridModel
0 Answers 63 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andrew
Top achievements
Rank 1
Andrew asked on 25 Jan 2011, 01:34 PM
Hi,

I am trying to use GridCommand and ToGridModel in combination but cannot find an easy way to do it.

My grid is set to custom binding, and my Controller method has a GridCommand parameter. From there I am hitting a WCF service, where after some processing I want to use ToGridModel on my IQueryable<T>. However ToGridModel(...) only accepts GridState or the sort, filter and group descripters as strings.

Because the GridCommand has them typed, I am unsure what the best way is to get from a GridCommand to parameters suitable for using with ToGridModel.

Any ideas?

Is there a way to convert a GridCommand to a GridState? Or can I use a different Mvc Action filter so the controller can use GridState instead of GridCommand? Or maybe there is an easy way of turning the sort, filter and group descriptors into strings (suitable for ToGridModel).

Many Thanks,

Andrew

p.s. Although I am using WCF services, they are not suitable for web service binding - which is why I am going the custom binding route.
Tags
Grid
Asked by
Andrew
Top achievements
Rank 1
Share this question
or