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

AllowMultipleView with dock to fill?

1 Answer 43 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
David A.
Top achievements
Rank 1
David A. asked on 10 Feb 2012, 07:43 PM
Hi,

We are trying to replace a previous third party calendar control with your RadCalendar.  We have a calendar that is on a form that can be resized.  If the form is maximized, we expect the # of months (rows)  to increase.  The MultiViewRows looks like a fixed value, so we really don't know how many rows to display based on the resolution of the user.

Is there a way to make this function like Outlook where changing the window size automatically adjusts the number of months to display?

Thanks,
David

1 Answer, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 15 Feb 2012, 04:13 PM
Hello David,

Thank you for your question.

You can achieve similar behavior by handling the SizeChanged event of the RadCalendar:
int rowHeight = 100;
int colWidth = 100;
 
public Form1()
{
    InitializeComponent();
 
    this.radCalendar1.AllowMultipleView = true;
    this.radCalendar1.SizeChanged += new EventHandler(radCalendar1_SizeChanged);
}
 
void radCalendar1_SizeChanged(object sender, EventArgs e)
{
    int columns = Math.Max(this.radCalendar1.Width / colWidth, 1);
    int rows = Math.Max(this.radCalendar1.Height / rowHeight, 1);
    this.radCalendar1.MultiViewRows = rows;
    this.radCalendar1.MultiViewColumns = columns;
}

I hope this will work for you. Feel free to ask if you have any additional questions.

Kind regards,
Ivan Todorov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
David A.
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Share this question
or