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

Disable switch from MonthView to DayView

10 Answers 67 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
rahul
Top achievements
Rank 1
rahul asked on 23 Jul 2012, 10:43 AM
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?

10 Answers, 1 is accepted

Sort by
0
Masha
Telerik team
answered on 25 Jul 2012, 06:51 AM
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.

0
Alon
Top achievements
Rank 1
answered on 23 Aug 2012, 12:15 PM
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!
0
Masha
Telerik team
answered on 24 Aug 2012, 08:06 AM
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.

0
Alon
Top achievements
Rank 1
answered on 27 Aug 2012, 11:08 AM
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
0
Alon
Top achievements
Rank 1
answered on 27 Aug 2012, 12:34 PM
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?
0
Masha
Telerik team
answered on 28 Aug 2012, 08:13 AM
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.

0
Kevin
Top achievements
Rank 1
answered on 12 Sep 2012, 06:10 PM
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.
0
Masha
Telerik team
answered on 13 Sep 2012, 07:23 AM
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.

0
Kevin
Top achievements
Rank 1
answered on 13 Sep 2012, 03:49 PM
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

0
Masha
Telerik team
answered on 14 Sep 2012, 07:57 AM
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.

Tags
ScheduleView
Asked by
rahul
Top achievements
Rank 1
Answers by
Masha
Telerik team
Alon
Top achievements
Rank 1
Kevin
Top achievements
Rank 1
Share this question
or