Duration/Interval TimeSpan column - filter

5 posts, 0 answers
  1. Stéphane
    Stéphane avatar
    15 posts
    Member since:
    Sep 2010

    Posted 08 Jan 2013 Link to this post

    Hi,

    I need to show TimeSpan values in a grid with sorting and filtering. Sorting is OK but filtering is not OK. I tested many ways but none worked.

    <MasterTableView AllowCustomPaging="false" AllowFilteringByColumn="true">
      <telerik:GridBoundColumn DataField="Duration" HeaderText="Duration" UniqueName="Duration" />
      <telerik:GridDateTimeColumn DataField="Duration" HeaderText="Duration" UniqueName="Duration" PickerType="TimePicker" DataType="System.TimeSpan" />
      ...
    </MasterTableView>
     
    Any solution ?

    Thanks in advance
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 08 Jan 2013 Link to this post

    Hi,

    I suppose you want to enable the range filtering function for GridDateTimeColumn. Try setting EnableRangeFiltering property for the specific column to true.

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Stéphane
    Stéphane avatar
    15 posts
    Member since:
    Sep 2010

    Posted 09 Jan 2013 Link to this post

    Hi,

    Thanks for your response. No it isn't this functionality I look for.

    I display TimeSpan values in my column (without date part) (00:03:12, 4.10:15:47, 07:59:59, ...), and I want these filters by exemple :
    • greater than 01:00:00
    • equal to 00:15:00
    • smaller or equal to 00:01:00
    • ...

    Regards,
    Stéphane

  5. Jared
    Jared avatar
    5 posts
    Member since:
    Oct 2014

    Posted 07 May 2015 Link to this post

    Any more thoughts on implementing this feature?  This is something I'm interested in adding to our website's grids.  I haven't jumped into yet so any direction would be helpful.  
  6. Kostadin
    Admin
    Kostadin avatar
    1711 posts

    Posted 12 May 2015 Link to this post

    Hi Jared,

    The GridDateTimeColumn is using picker controls to select date and they are bound to a DateTime object. Because of this you are seeing the error when trying to filter column bound to a TimeSpan.
    Note that in this case you would need to handle the filtering manually. You could use an approach similar to the one described in this article.

    Regards,
    Kostadin
    Telerik
     

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

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017