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
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
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
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 >>
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
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
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);
}
}
Yana,
Forgot to ask, can you please provide a sample implementation ActiveViewDefinition property?
Thank you
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