Disable switch from MonthView to DayView

11 posts, 0 answers
  1. rahul
    rahul avatar
    25 posts
    Member since:
    Jan 2011

    Posted 23 Jul 2012 Link to this post

    In MonthView:
    When I double click on first row of the day(date row) it takes me to th Day view. I want to disbale this feature. As I don't want to distract user's view. (see screenshot attached for better understanding). How can I do that?

  2. Masha
    Admin
    Masha avatar
    355 posts

    Posted 25 Jul 2012 Link to this post

    Hello Rahul,

    To disable GroupHeaderButton from MonthView, find

    <Style x:Key="TimeRulerMonthViewItemStyle" TargetType="local:TimeRulerMonthViewItem">
        <Setter Property="Foreground" Value="{StaticResource MonthViewTimeRulerItemForeground_Normal}" />
        <Setter Property="Margin" Value="0 -1 -1 0" />
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="local:TimeRulerMonthViewItem">
              <Grid>
                <telerik:RadButton Padding="0" VerticalAlignment="Top" Height="22" Style="{StaticResource GoToDayButtonStyle}" Command="local:RadScheduleViewCommands.SetDayViewMode" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.DateTime.Date}">
                  <ContentPresenter Margin="{TemplateBinding Padding}" />
                </telerik:RadButton>
                <telerik:RadToggleButton Visibility="{Binding ExpandButtonVisibility}" IsChecked="{Binding IsExpanded, Mode=TwoWay}" Style="{StaticResource ExpandMonthViewButtonStyle}" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
              </Grid>
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </Style>

    in your RadScheduleView control and remove Command="local:RadScheduleViewCommands.SetDayViewMode" from telerik:RadButton.

    You could also remove <telerik:DayViewDefinition />   from the view definition, this way you will disable
    GroupHeaderButton automatically.

    Hope this helps.


    Regards,
    Maria
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Alon
    Alon avatar
    13 posts
    Member since:
    Jun 2012

    Posted 23 Aug 2012 Link to this post

    Great, thanks! We had a similar issue that came up, and this answered our question as well.

    I was just wondering though, is there a way to so this from code (an inherited view)?

    I basically want to disable all daily view drill downs ... from any month or weekly view down to the day view (and I can not remove the views themselves, as I need them available thorugh other UI elements).

    We have a custom view that inherits from WeekViewDefinition, but I am using a single xaml style/skin for all my schedule views.
    To attempt a global change, I have removed "local:RadScheduleViewCommands.SetDayViewMode" and "{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.DateTime.Date}" from the following locations:
     TimeRulerGroupItemStyle
     TimeRulerMonthViewTodayItemStyle
     TimeRulerMonthViewItemStyle
     TimeRulerMonthViewTodayItemStyle

    Am I headed in the correct direction? And what other changes should I make?

    Any assistance would be appreciated!
  5. Masha
    Admin
    Masha avatar
    355 posts

    Posted 24 Aug 2012 Link to this post

    Hello Rahul,

    To disable GroupHeaderButton of DayView you have to remove Command="local:RadScheduleViewCommands.SetDayViewMode" in  following templates:

    TimeRulerGroupItemStyle
    TimeRulerGroupItemStyle_Vertical
    TimeRulerMonthViewItemStyle
    TimeRulerMonthViewTodayItemStyle
    TimeRulerGroupItemStyle
    TimeRulerGroupItemStyle_Vertical
    TimeRulerMonthViewItemStyle
    TimeRulerMonthViewTodayItemStyle

    Hope this helps.


    Kind regards,
    Maria
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Alon
    Alon avatar
    13 posts
    Member since:
    Jun 2012

    Posted 27 Aug 2012 Link to this post

    Hello, Thanks for the reply!

    To get my XAML for the resource, I copied the markup from Telerik.Windows.Controls.ScheduleView.xaml from the appropriate theme folder. As my original post stated, I already updated these 4 templates (that you duplicated). Though from the weekviews, I am still able to click on the Day header and it switches to day view. Are there other templates I need to change, are they missing from your XAML or should I use Blend to generate those templates? Or ... Did I do something wrong?

    Also, what I really need to do is remove the group Header button from the weekly views, both the standard and a custom weekly view.  I just didn't find any more instances of "SetDayViewMode" than those I changed !!!

    Thanks Again!

    Alon
  7. Alon
    Alon avatar
    13 posts
    Member since:
    Jun 2012

    Posted 27 Aug 2012 Link to this post

    After some digging around ... I located the "GroupHeaderTemplate" section.

    Within the local:GroupHeaderButton xaml, I removed the Command and the CommandParameter bindings and this seems to disable all view switching.

    Are the changes made previously still required?
  8. Masha
    Admin
    Masha avatar
    355 posts

    Posted 28 Aug 2012 Link to this post

    Hello Rahul,

    Previous changes are required too. Like I mentioned before you should remove the Command="local:RadScheduleViewCommands.SetDayViewMode" everywhere in the control  to disable all view switching in ScheduleView.

    Hope this helps.

    Regards,
    Maria
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  9. Kevin
    Kevin avatar
    17 posts
    Member since:
    Jul 2012

    Posted 12 Sep 2012 Link to this post

    My appologies.  Where are the templates located?  I can't seem to find it.  I want to disable the weekview, monthview and timelineview.  How do I go about doing that task?  Thanks in advance.
  10. Masha
    Admin
    Masha avatar
    355 posts

    Posted 13 Sep 2012 Link to this post

    Hello Kevin,

    You can find all the  templates in your RadControls installation folder. Choose Themes.Implicit, after that choose the theme you are using, inside it you will see all templates.

    The easiest way to disable the the weekview, monthview and timelineview is not define them in view definition of RadScheduleView.

    <telerik:RadScheduleView x:Name="theScheduleView">         
        <telerik:RadScheduleView.ViewDefinitions>
            <telerik:DayViewDefinition />
        </telerik:RadScheduleView.ViewDefinitions>
    </telerik:RadScheduleView>

    Hope this helps.

    Greetings,
    Maria
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  11. Kevin
    Kevin avatar
    17 posts
    Member since:
    Jul 2012

    Posted 13 Sep 2012 Link to this post

    Thank you for your reply.  After lots of reading and searching I found the following way to disable them.  It's working now.  thanks
    Using properties to disable.

    <WeekView UserSelectable ="false" />

     

    <MonthView UserSelectable ="false" />

     

    <TimelineView UserSelectable="false" />

    or
    Hack by CSS.

    .rsHeaderWeek()

    { display: none !important; }

    .rsHeaderMonth()

    { display: none !important; }

    .rsHeaderTimeline()

    { display: none !important; }


    Now I'm searching for a way to disable the advance form from popup when I double click on an appointment to modify.  I will be writing my own code to handle the updates.  Can you help?  Thanks in advance

  12. Masha
    Admin
    Masha avatar
    355 posts

    Posted 14 Sep 2012 Link to this post

    Hello Kevin,

    After your last post, I noticed that you use Scheduler for ASP.NET.  This forum is about RadControls for Silverlight.

    For any further assistance you can post your questions in the ASP.NET AJAX forums  

    Regards,

    Maria
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Back to Top
DevCraft banner