Solved

Seleted mode

Posted on 2004-10-14
3
236 Views
Last Modified: 2010-04-15
Hi Experts,

How do I get value of CalendarSelectionMode and recognize which mode was used week, weekday. dayweekmonth ?

Thanks.
0
Comment
Question by:fpoyavo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Author Comment

by:fpoyavo
ID: 12310543
I HAVE FOUND IT : MyCalendar.SelectedDates

Thanks to all.
0
 
LVL 8

Expert Comment

by:Razzie_
ID: 12310666
Glad you found it fpoyavo!

To get your points refunded, please go to the Community Support TA and ask to Close and refund this question and a moderator will close it.

Cheers,

Razzie
0
 
LVL 3

Accepted Solution

by:
aacool earned 250 total points
ID: 12310694
The SelectionMode property for a Calendar web control returns a value of the enum System.Web.UI.WebControls.CalendarSelectionMode

This can have the values CalendarSelectionMode.Day,CalendarSelectionMode.Week,CalendarSelectionMode.DayWeekMonth or CalendarSelectionMode.None

To set the value, e.g.
      void Selection_Change(Object sender, EventArgs e)
      {

         // Set the day selection mode.
         Calendar1.SelectionMode =
            (CalendarSelectionMode)ModeList.SelectedIndex;

      }


To get the value in C#
 void Selection_Change(Object sender,EventArgs e)
{
        CalendarSelectionMode selectedMode = Calendar1.SelectionMode;
        switch(selectedMode)
        {
           case CalendarSelectionMode.Day:
                                                               //do day processing
                                                             break;
           case CalendarSelectionMode.Week:
                                                              // do week processing
                                                             break;
           case CalendarSelectionMode.DayWeekMonth:
                                                              // do month processing
                                                              break;
        }
}

Hope this addresses your question.
aacool
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question