Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

Timebar SelectionEnd off by a day.

$
0
0
Hello Nate,

The described behavior is caused by the nature of the selection feature of RadTimeBar. Basically, the selected interval doesn't include the end date, but it is defined just before it. This behavior reminds of excluding interval end points in mathematics. 

To achieve your requirement you can use several approaches:
  • Add +1 Tick to the DateTime object that defines the selection end.
  • Change the format string of the selection thumb's Title so that it displays the full date. In your case when you select (for example) 05.10.2012, the DateTime object will have its time set to 12:00:00A.M. and the interval coercion will change it to the 04.10.2012 11:59:59P.M. If you define another format string for the date you will see more accurate info. Here is an example in code:
    void timeBar_Loaded(object sender, RoutedEventArgs e)
    {
        var thumb = ChildrenOfTypeExtensions.FindChildByType<SelectionThumb>(this.timeBar);
        thumb.TitleFormatString = "{0:G} - {1:G}";
    }
  • Hide the Title of the selection thumb. Since, the selection range is displayed in the date pickers above the diagram, the additional info in the thumb is not required and you can remove it.

I hope that this information is helpful. 
 
Regards,
Dinko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>