I'm using Winforms 2011.3.11.1116. I'm trying to position another control on top of a RadCalendar (a textbox) as part of a small WYSIWYG calendar-printing app. I will position the textbox to fill the largest remaining space on the calendar--meaning the largest space on the calendar that does not contain any days from the focused month--, either at the top or bottom. Of course, to do this, I need to be able to figure out WHERE the largest remaining space is.
I have the calendar in a 6 row month view, and I set ShowOtherMontDays to false. I have tried the following:
1) My first thought was to ask the DefaultView for the month and the first and last day shown in the view, then do the necessary calculations to figure out where the "space" was. No go, because the ViewStartDate and ViewEndDate properties refer to the first and last day of the month (which I can figure out myself from the month), NOT the first and last element rendered.
2) Then I thought I should iterate through the elements, getting the dates and finding the min and max. But ... there is no iterable collection that I can find. That was, to put it mildly, surprising. (As it was in a related thread for a different technology:http://www.sitefinity.com/devnet/forums/sitefinity-3-x/general-discussions/radcalendar-search-date-and-bold-it.aspx ).
3) Next I thought to try a combination of Navigating and ElementRender. In Navigating, I would set a Min and Max date to a sentinel value, then in ElementRender I would find the min and max dates as they were rendered. However, for some odd reason, at least one date in the previous view is, at least sometimes, rendered after Navigating fires. Though this is annoying, I could cache all the dates, then figure out which one was not like the others (say, sort the list, and find wherever there was a gap between dates). But, there is also the problem of the initial view, which does not trigger the Navigating or Navigated events.
This seems much too complicated, to me, so I guessed that I was probably not thinking of the best way to solve this problem.
Thoughts?