Expose TimeBarBase.IntervalItems or have a way to set it.

2 posts, 0 answers
  1. David
    David avatar
    2 posts
    Member since:
    Oct 2012

    Posted 02 Apr 2013 Link to this post

    Hi, 

    I would like to allow a user to select a period of time by clicking the time bar.  It would be helpful for me to only allow the user to select a full valid time period.

    For example, I want to force a user to pick a full month of time.  When they click anywhere in a month it selects the range from the 1st to the last day of the month.  This I can accomplish pretty easily by using the Selection Changed event.  Where it gets tricky is that I have periods that I want to allow the user to select.  This period is the minimum date/time selection I wish to allow the user to choose.  For example, I may want to allow the user to choose all of January however February I may allow them to select 2/1 - 2/14 or 2/15 - 2/28.

    It seems like I could accomplish this if I were able to fill in the IntervalItems property on the control but the setter for that is private.  

    So my question is this.  Is there any way I can specify the exact bands of time that the user is allowed to select?  Min range / Max range does not work as this can change from month to month.

    Thanks,
    David Sandor
  2. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 05 Apr 2013 Link to this post

    Hello David Sandor,

    Unfortunately, this scenario is not supported in the current version of the control. Basically, RadTimeBar changes the collection of the interval items dynamically, based on a couple of conditions such as available space, font size, interval types in the Intervals collection, visible period, etc.

    Since your case is very specific, I am not quite sure I can offer you a workaround either. The only thing that I can suggest, is to try to create your custom SelectionThumb control that implements a specific coercing mechanism that fits your requirements and use it in the place of the default one in the template of the timeBar control. This, however, would require major re-templating of the timeBar control and the effort to create a custom SelectionThumb control.

    Kind regards,
    Tsvetie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top