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

[Solved] Hide extra weeks?

2 Answers 98 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
D
Top achievements
Rank 1
D asked on 02 Nov 2010, 07:51 PM
Hello,
I have a calendar control as defined below. The calendar works and looks fantastic, but every month it renders shows 6 rows, even if the month it's displaying only needs 4, which means I'm displaying up to two whole weeks of the month following the current one. I'd like to minimize this somehow. I don't see this behavior occuring on the demos, so I'm confused as to why it's happening now.

<%: 
    Html.Telerik().Calendar()
         .Name("CalendarControl")
         .Value(DateTime.Today)
         .MinDate(Model.AssignmentStartDate)
         .MaxDate(Model.AssignmentEndDate)
         .Theme("Web20")
         .ClientEvents(events =>
                                events.OnChange("CalendarDateChanged"))
         .Selection(builder => builder.Action("Monthly", new { date = "{0}", theme = Request.QueryString["theme"] }))
         .Value(ViewData["date"] != null ? (DateTime)ViewData["date"] : DateTime.Today).HtmlAttributes(new { style="margin-bottom:30px" })
                        %>

2 Answers, 1 is accepted

Sort by
0
Accepted
Alex Gyoshev
Telerik team
answered on 03 Nov 2010, 07:40 AM
Hi D,

If you mean the behavior observed when you navigate to Feb 2010 on the calendar / first look demo, then: The calendar always renders 6 rows so that there is no resizing of the component. We did this intentionally, so that it does not push the layout around. After all, the dates from the other month are colored differently and this should differentiate between the days in the current month and the previous / next months.

Best wishes,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
D
Top achievements
Rank 1
answered on 03 Nov 2010, 05:26 PM
My apologies, what I was confusing for a smaller number of rows on the calendar demo was simply a smaller font size allowing the calendar itself to render smaller.
Tags
Calendar
Asked by
D
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
D
Top achievements
Rank 1
Share this question
or