ViewMode deprecated?

9 posts, 0 answers
  1. InNeedForKnowledge
    InNeedForKnowledge avatar
    9 posts
    Member since:
    Jan 2012

    Posted 15 Jun 2012 Link to this post

    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;
       }
  2. Lancelot
    Lancelot avatar
    251 posts
    Member since:
    Jul 2012

    Posted 15 Jun 2012 Link to this post

    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
  3. DevCraft banner
  4. InNeedForKnowledge
    InNeedForKnowledge avatar
    9 posts
    Member since:
    Jan 2012

    Posted 15 Jun 2012 Link to this post

    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
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 18 Jun 2012 Link to this post

    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 >>

  6. Ranjit
    Ranjit avatar
    5 posts
    Member since:
    Jul 2016

    Posted 29 Jul in reply to Yana Link to this post

    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

  7. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 01 Aug Link to this post

    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.
  8. Ranjit
    Ranjit avatar
    5 posts
    Member since:
    Jul 2016

    Posted 08 Aug in reply to Yana Link to this post

    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);
                }
            }

  9. Ranjit
    Ranjit avatar
    5 posts
    Member since:
    Jul 2016

    Posted 08 Aug in reply to Yana Link to this post

    Yana,

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

    Thank you

    Ranjit

  10. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 11 Aug Link to this post

    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.
Back to Top
DevCraft banner