GridDateTimeColumn EnableRangeFiltering defaults

4 posts, 0 answers
  1. Marco
    Marco avatar
    5 posts
    Member since:
    Apr 2015

    Posted 14 Apr 2015 Link to this post

    I would like to know how to set the defaults of the From and To dates in a GridDateTimeColumn with EnableRangeFiltering="true".

    My questions are in particular:

    1) how do I set the From and To dates, and which date format should I use when setting them (dd/mm/yyyy, mm/dd/yyyy or yyyy/mm/dd) and which separator (/, - or .)?

    2) how do I set the filter to be *between* the From/To dates and don't let the user to change it (not the dates, the type of filter)?

    If there is a documentation page where these questions are answered then could you please share the link to it?

  2. Marco
    Marco avatar
    5 posts
    Member since:
    Apr 2015

    Posted 15 Apr 2015 in reply to Marco Link to this post

    I think I figured it out by myself. 

    1) First put the following inside the telerik:GridDateTimeColumn tag:

    UniqueName="CancelDate" EditDataFormatString=""

    and this in the code behind:

    GridColumn date = RadGrid1.MasterTableView.GetColumnSafe("Date");
    date.CurrentFilterValue = string.Format("{0} {1}", From.ToShortDateString(), To.ToShortDateString());

    2) Put the following inside the telerik:GridDateTimeColumn tag:

    ShowFilterIcon="false" CurrentFilterFunction="Between"

  3. Maria Ilieva
    Maria Ilieva avatar
    4017 posts

    Posted 17 Apr 2015 Link to this post

    Hello Marco,

    I'm glad that you were able to develop the required functionality on your end. Do let us know if further assistance is needed.

    Maria Ilieva

    See What's Next in App Development. Register for TelerikNEXT.

  4. Jaya
    Jaya avatar
    85 posts
    Member since:
    Mar 2011

    Posted 22 Apr 2015 in reply to Maria Ilieva Link to this post



    Can you solve this
Back to Top