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

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

1 Answer 31 Views
TimeBar
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 02 Apr 2013, 07:27 PM
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

1 Answer, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 05 Apr 2013, 02:49 PM
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.

Tags
TimeBar
Asked by
David
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Share this question
or