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

Duration/Interval TimeSpan column - filter

4 Answers 220 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mat
Top achievements
Rank 1
Mat asked on 08 Jan 2013, 01:24 PM
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

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 09 Jan 2013, 04:41 AM
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.
0
Mat
Top achievements
Rank 1
answered on 09 Jan 2013, 07:39 AM
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

0
Jared
Top achievements
Rank 1
answered on 07 May 2015, 06:56 PM
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.  
0
Kostadin
Telerik team
answered on 12 May 2015, 09:24 AM
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.

 
Tags
Grid
Asked by
Mat
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Mat
Top achievements
Rank 1
Jared
Top achievements
Rank 1
Kostadin
Telerik team
Share this question
or