We have a grid column that is display date in M/DD/YYYY format. The Data set for this date column includes a time value. When the user groups by this column the grouping is including the time so there are many groups for the same date. Is there a way to tell the grid to ignore the time for the grouping? I would have assumed it would grouped based on the format displayed to the user but its not working that way.
Hello Tammy,
I've opened a private case with #CAS-190782-J7J3R5 on your behalf. Let's continue there.
Best regards,
Stamen Stoychev
We have that all setup our paging, etc is working fine. If it's easier we can arrange a call. I can send you the exact grid parameters if we switch this to a private case.
Actually, you won't need to implement the compare function server-side. I was wrong in my previous reply. After playing around with this a little bit more I think this could be because you haven't configured DataSourceUrl for your grid. Without it the grid will assume that it is bound locally and remote operations will fail.
You need something like this in your setup:
model.DataSourceUrl = Url.Action("GetData");
or if you are using the wrappers
...
.DataSourceUrl(Url.Action("GetData"))
And a corresponding action. For example:
[GridDataSourceAction] public ActionResult GetData() { return View(Product.GetProductData().AsQueryable()); }
When grouping, the sort portion will be executed on the server then when the data is sorted it'll be taken over by the custom function on the client.
If this still doesn't work and you can't provide a sample that I can look at, please let me know so we can arrange a call through a private support case.
It's remote group by
Defining the grid in the controller should not affect the end result. I modified Martin's sample to confirm. I am attaching it for your reference.
Are you sure that you are using local GroupBy? In your code you specify it like this:
groupByWrapper.Type(isLocal ? OpType.Local : OpType.Remote)
If you are using remote GroupBy, the solution will be server-side, however, you will also have to do all remote operations manually then as you won't be able to take advantage of the GridDataSourceAction attribute to let the MVC wrappers do them for you.
Let me know if this is the case, so I can help you with a server-side implementation of the requirements.
5633.igGrid_Sample_MVC5.zip