System.Exception: 'Days between ViewStart and ViewEnd should be between 1 and MaximumViewDays' in c#

Anonymous
2024-06-09T06:50:07.66+00:00

I want to select multiple days in my monthView1, but

2

the error message say."System.Exception: 'Days between ViewStart and ViewEnd should be between 1 and MaximumViewDays'"

and here my code.

private void monthView1_SelectionChanged(object sender, EventArgs e)
        {
            calendar1.SetViewRange(monthView1.SelectionStart, monthView1.SelectionEnd);
        }
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,007 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Waqar Kabir 1 Reputation point
    2024-07-16T17:51:11.0366667+00:00

    I think the code is throwing custom exception and suggesting that selected dates should be within range which is probably set in MaximumViewDays.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.