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

[Solved] Date Field Not Applying Filter

1 Answer 96 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.
Landon
Top achievements
Rank 2
Landon asked on 18 Oct 2011, 09:54 PM
Hi,

I'm attempting to apply a filter on a DateTime Field in a MVC Grid. The grid is being populated by a Dictionary that is pulled from a table where the DateTime field is non-nullable. The DateTime field also includes the time, which is a necessity to the client. Upon trying any Filter type, I can enter the Date, but when I click "Filter" to apply the filter, the loading spinner on the grid continues to spin without rebinding the grid. 

When attempting this with FireBug running, I get no Javascript/Jquery trying to run in the Console and the Databind ActionResult never fires like it should. When attempting this on any of my other fields (string) they work perfectly. Below is the code for my Grid:

@(Html.Telerik().Grid<EWorkTicket.Models.WorkTickets>()
        .Name("LimboGrid")
        .DataKeys(keys =>
        {
            keys.Add(t => t.TicketID);
            keys.Add(t => t.TicketNo);
        })
        .HtmlAttributes(new { @class = "myGrid" })
        .DataBinding(dataBinding =>
        {
            dataBinding.Ajax()
                .Select("_BindLimboGrid", "Management");
        })
        .Filterable()
        .Columns(columns =>
        {
            columns.Bound(t => t.TicketNo).Width("10%");
            columns.Bound(t => t.Customer).Width("15%");
            columns.Bound(t => t.Location).Width("15%");
            columns.Bound(t => t.ProjectNumber).Width("10%");
            columns.Bound(t => t.CreatedBy).Width("15%");
            columns.Bound(t => t.DateCreated).Width("10%");
 
            columns.Template(@<a href="/Ticket/Create/@item.TicketID">EDIT</a>)
                    .ClientTemplate("<a class ='gridButton blue small' href='/Ticket/Create/<#= TicketID #>'>EDIT</a>")
                    .Title("EDIT")
                    .Width("5%");
        
            @* Hidden Columns *@
            columns.Bound(t => t.ProjectID).Hidden();
            columns.Bound(t => t.TicketID).Hidden();
        })
        .Pageable()
        .Scrollable(scroll => scroll.Enabled(true).Height(ViewBag.GridHeight != null ? ViewBag.GridHeight : 300))
        .Sortable()
)

I've also attached an image of what is going on on the GUI side. Note: filtering works when I change the DateTime field to a string field and filter it that way, but I would prefer to use the actual DatePicker control.

I'm currently using version 2011_2_712 and am unfortunately in a situation where I cannot upgrade at the moment. 

Is there a work-around for this bug, or do I have something wrong with my syntax? Any help is greatly appreciated.

Best Regards,
Landon

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 19 Oct 2011, 08:31 AM
Hello Landon,

 There is a known issue with the 2011.2.712 which prevents successful filtering of date columns. The 2011.2 914 version addresses this bug as well as others.

Regards,
Atanas Korchev
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
Tags
Grid
Asked by
Landon
Top achievements
Rank 2
Answers by
Atanas Korchev
Telerik team
Share this question
or