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

Item Intervals/Group intervals On initial Load or render

1 Answer 45 Views
TimeBar
This is a migrated thread and some comments may be shown as answers.
Balaji
Top achievements
Rank 1
Balaji asked on 18 Aug 2011, 12:23 AM
Hi, 

we want to set the Selection Period of the timebar based on item intervals unit ( ie. if item interval is Day then we will select one day of the last period) and if the item unit  is in month then we need to month at run time.

So on the initial load, we are not getting the item interval count ("timebar.itemIntervals")? So in which event will i get the item or group intervals on the initial load?

Thanks & Regards
B.Balaji

1 Answer, 1 is accepted

Sort by
0
Missing User
answered on 23 Aug 2011, 11:25 AM
Hi Balaji,

You can get the current item interval in TimeBar.ItemIntervalChanged event via TimeBar.CurrentItemInterval property. This event will also fire on initial load, when the best current item interval is set. For example:
public MainPage()
{
    InitializeComponent();
    timeBar1.ItemIntervalChanged += new System.EventHandler<DrillEventArgs>(timeBar1_ItemIntervalChanged);
}

void timeBar1_ItemIntervalChanged(object sender, DrillEventArgs e)
{
    if (timeBar1.CurrentItemInterval is MonthInterval)
    {
        timeBar1.SelectionStart = new DateTime(2011, 05, 1);
        timeBar1.SelectionEnd = new DateTime(2011, 05, 31);
    }
}

In order to get the current group interval you can use TimeBar.GroupIntervalChanged event and TimeBar.CurrentGroupInterval property.

I hope this information helps.

Greetings,
Polina
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
TimeBar
Asked by
Balaji
Top achievements
Rank 1
Answers by
Missing User
Share this question
or