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

ViewMode deprecated?

8 Answers 102 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
InNeedForKnowledge
Top achievements
Rank 2
InNeedForKnowledge asked on 15 Jun 2012, 08:08 PM
I've created a Silverlight custom control which includes a RadScheduler control and I used the code  added below, but since I migrated to the Q2 2012 Library I'm having a problem with the statement on the switch. Reading the RadScheduleView I need to use the ActiveViewDefinition property can you explain me how can I get the ViewMode selected in the RadScheduleView control.

Thanks

switch (schedulerControl.scheduler.ViewMode)
   {
    case SchedulerViewMode.Day:
     // do smething
     break;
    case SchedulerViewMode.Week:
     // do smething
     break;
    case SchedulerViewMode.Month:
     // do smething
     break;
    default:
     // do smething
     break;
   }

8 Answers, 1 is accepted

Sort by
0
Lancelot
Top achievements
Rank 1
answered on 15 Jun 2012, 09:46 PM
Hi InNeed,

The only change to the control is where the InvertedBooleanConverter resides. In your project you would have referenced it in the Telerik.Windows.Controls.ScheduleView.dll library. That is now obsolete.

You need to reference Telerik.Windows.Controls for the InvertedBooleanConverter. This should solve your issue, if yes, please mark this post as "Answer" for other telerik community members to find.

Good Luck!
Lancelot
0
InNeedForKnowledge
Top achievements
Rank 2
answered on 15 Jun 2012, 10:45 PM
Hi Lancelot,

Maybe I didn't explain myself, my problem is RadScheduleView does not contain a definitnion for the ViewMode (the RadScheduler does). Since this property is not present, how can I determine which view is active in the RadScheduleView. In the documentation of the RadScheduleView says I shouldn't use the ViewMode property, instead I should use ActiveViewDefinition, so which property in the ActiveViewDefinition tells me which view (day, month, etc.) is actvie?

thanks
0
Yana
Telerik team
answered on 18 Jun 2012, 08:58 AM
Hi Jose,

ActiveViewDefinition is exactly the property that you should use - you should cast it to DayViewDefinition, WeekViewDefinition. etc.. in order to find the active view.

Hope this helps.

Greetings,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Ranjit
Top achievements
Rank 1
answered on 29 Jul 2016, 10:52 PM

Yana,

Can you please post an example for this? Here is what I am using in my old code.[I inherited this code.]

private SchedulerViewMode getViewModeFromViewString(string strView)
        {
            if (strView == "day")
            {
                return SchedulerViewMode.Day;
            }
            else if (strView == "week")
            {
                return SchedulerViewMode.Week;
            }
            else if (strView == "month")
            {
                return SchedulerViewMode.Month;
            }
            else if (strView == "timeline")
            {
                return SchedulerViewMode.Timeline;
            }
            else
            {
                throw new Exception("unknown view string:  " + strView);
            }
        }

I dont see ActiveViewDefinition property. Can you help?

--Ranjit

0
Yana
Telerik team
answered on 01 Aug 2016, 10:17 AM
Hi Ranjit,

ActiveViewDefinition is a property of RadScheduleView of type ViewDefinitionBase and can be cast to DayViewDefinition, TimelineViewDefinition, etc.

Again, I'd ask you to give us more details on the scenario you have, so we to be able to provide proper assistance.

Regards,
Yana
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Ranjit
Top achievements
Rank 1
answered on 08 Aug 2016, 03:05 PM

Thanks again for your quick response.

Here is what we are trying to do.(Partial code snippet.) This is a private method returns SchedularViewMode, based on the view passed. How do we upgrade to your latest.
private SchedulerViewMode getViewModeFromViewString(string strView)
        {
            if (strView == "day")
            {
                return SchedulerViewMode.Day;
            }
            else if (strView == "week")
            {
                return SchedulerViewMode.Week;
            }
            else if (strView == "month")
            {
                return SchedulerViewMode.Month;
            }
            else if (strView == "timeline")
            {
                return SchedulerViewMode.Timeline;
            }
            else
            {
                throw new Exception("unknown view string:  " + strView);
            }
        }

0
Ranjit
Top achievements
Rank 1
answered on 08 Aug 2016, 03:08 PM

Yana,

Forgot to ask, can you please provide a sample implementation ActiveViewDefinition property?

Thank you

Ranjit

0
Yana
Telerik team
answered on 11 Aug 2016, 09:58 AM
Hi Ranjit,

How is this method used in a project? To change the current ViewDefinition according to the passed string? Can you give us more details on your implementation?

Regards,
Yana
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
ScheduleView
Asked by
InNeedForKnowledge
Top achievements
Rank 2
Answers by
Lancelot
Top achievements
Rank 1
InNeedForKnowledge
Top achievements
Rank 2
Yana
Telerik team
Ranjit
Top achievements
Rank 1
Share this question
or