Filterable Date Range

9 posts, 0 answers
  1. Craig
    Craig avatar
    35 posts
    Member since:
    Feb 2012

    Posted 06 Feb 2013 Link to this post

    Hi there,
    I am trying to figure out how to create a filter based on a Date Range with the Kendo Grid?
    I can't seem to find an example of this so I was hoping somebody might be able to help me.

    Thanks in Advance
  2. Craig
    Craig avatar
    35 posts
    Member since:
    Feb 2012

    Posted 06 Feb 2013 Link to this post

    Oops I was able to figure this out after some digging around. Thanks!
  3. Jackelin España
    Jackelin España avatar
    2 posts
    Member since:
    Jan 2013

    Posted 06 Feb 2013 Link to this post

    Like your solves? example please.
  4. Bharat
    Bharat avatar
    5 posts
    Member since:
    Apr 2014

    Posted 01 Oct 2014 Link to this post

    How can I Create a date range filter on one column and "Starts with" , "Is equal to" filter on another column for the same Grid in RAZOR
  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2598 posts

    Posted 03 Oct 2014 Link to this post

    Hi Bharat,

    If I understand you correctly you would like to customize the filter menu in the Kendo UI Grid. If this is the case then I suggest you to check the following demo that shows how to create separate filter for each column:

    http://demos.telerik.com/kendo-ui/grid/filter-menu-customization

    In case you have any further questions, then please open a separate support request with some more detailed information and we will be happy to help.

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Bharat
    Bharat avatar
    5 posts
    Member since:
    Apr 2014

    Posted 06 Oct 2014 in reply to Kiril Nikolov Link to this post

    Thanks for the reply Kiril.  This is not what I meant. As you can see in this code I have done  .Extra(true)
    . This gives me two set of filters on  column Name. First filter (Starts with)  AND/OR second filter (Starts with) (name starts with a AND starts with b)   here I want only one set of filter. This can be archived by making .Extra(False). Good so far. But the problem is when on the same grid I put filter on the date column.  .Extra(false) will also take away second set of filter from the date column where as in date column I want two set of filter to select the date range (Date after ....  and... date Before ...)



     .Refresh(true))
                                                .Filterable(filterable => filterable
                                                .Extra(true)
                                                        .Operators(operators => operators
                                                        .ForString(str => str.Clear()
                                                        .StartsWith("Starts with")
                                                        .IsEqualTo("Is equal to")
                                                        .IsNotEqualTo("Is not equal to")
                                                        ))
                                                )
                                             .DataSource(dataSource => dataSource
                                        .Ajax()
                                        .PageSize(15)
                                        .ServerOperation(false)
                                        .Read(read => read.Action("Shipment_Read_nw", "Home")))
                                        )
  7. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2598 posts

    Posted 08 Oct 2014 Link to this post

    Hi Bharat,

    You can use the filterMenuInit event, where you can detect the column field for the date column and manipulate the filters there. Like for example:

    http://dojo.telerik.com/AGUxa

    If this does not resolve the issue, then please edit the provided example in order for us to better understand the problem.

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  8. Sam
    Sam avatar
    13 posts
    Member since:
    Aug 2015

    Posted 07 Jun Link to this post

    For your date example at:

    http://dojo.telerik.com/AGUxa

    If you leave the first date textbox empty, fill in a date in the second textbox, and click the Filter button, it works as expected, showing all items before the specified date. But if you open the Filter popup again, it puts the date you entered into the FIRST textbox instead of into the second one. Is there a way to fix this?

    Thanks.

  9. Tsvetina
    Admin
    Tsvetina avatar
    2076 posts

    Posted 09 Jun Link to this post

    Hello Sam,

    This would not be possible with the built-in filter, as it just applies the existing expression and in the case that you describe, the expression is "BirthDate is less than someValue".

    You can achieve your requirement by creating custom content for the filter menu in the filterMenuInit event. One possible way is shown in the following Dojo:
    http://dojo.telerik.com/@tsveti/UNijO/22

    Regards,
    Tsvetina
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top