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

Count the number of weeks or days in month view

1 Answer 209 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 25 Nov 2010, 11:18 AM
I'm trying out the scheduler control and it's working great. The tutorials, videos and articles on this site helped enormously.

I have a web page with 2 columns. In one column is a Scheduler (that's always in month view) and in the other is a Repeater with a Label inside. Because some months have more weeks than others I need a way of counting how many weeks the Scheduler is displaying so that the Repeater repeats the right amount of times - if the Scheduler has 5 weeks in its month, the Repeater should repeat 5 times; if the Scheduler has 6 weeks, the Repeater should repeat 6 times.

Is there a way of counting how many weeks are currently in the Scheduler's month (or what the current month view's start and end dates are so that I can work out the weeks that way)?

Also, the scheduler's Subject field contains an integer value. For each week I'd like to mathematically add up the totals of each Subject and display the grand weekly total in the Repeater's Label. How do I do this?

Hope somebody can help!

1 Answer, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 30 Nov 2010, 03:38 PM
Hi Dave,

You can get the values of VisibleRangeStart and VisibleRangeEnd properties of the RadScheduler. They will show you the first and the last visible days in the MonthView. After that you can use this forum post to get how many weeks are there between two dates.

As for the second question you can use the GetAppointmentsEnclosingRange method of the RadScheduler to get all appointments in one week. After that you can iterate through all appointments returned by the method and sum the subjects to display the grand weekly total in the Repeater's Label.

Hope this helps.

Greetings,
Veronica Milcheva
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Scheduler
Asked by
Dave
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Share this question
or