Howto customize template for ScheduleDaysView

Hi,
I trying to set my own template forScheduleDaysView:
<Style TargetType="syncfusion:ScheduleDaysView">
 <Setter Property="Template">
  <Setter.Value>
   <ControlTemplate TargetType="syncfusion:ScheduleDaysView">
     <../>
   </ControlTemplate>
  </Setter.Value>
 </Setter>
</Style>

Where I put any control to ControlTemplate, I get an Exception:

Message "Value does not fall within the expected range." string
at Windows.UI.Xaml.UIElement.Measure(Size availableSize)
at Syncfusion.UI.Xaml.Schedule.LoopItemsPanel.MeasureOverride(Size availableSize)


What is wrong? And where I can get a default template for standart views?

5 Replies

VR Vigneshkumar Ramasamy Syncfusion Team October 21, 2015 01:24 PM UTC

Hi Dmitry,

Thanks for using Syncfusion product.

We have created a separate incident for this query, please login to below location to have follow up regarding this query.

Link: https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let us know if you have any concerns.

Regards,

Vigneshkumar R



DM Dmitry October 23, 2015 11:20 AM UTC

Thank you.

I need to customize only hour rule (see the screenshot). May be i need to change another style instead ScheduleDaysView?




VR Vigneshkumar Ramasamy Syncfusion Team October 26, 2015 08:45 AM UTC

Hi Dmitry,

Could you please provide more information about your requirement? So that we can analyze on your requirement further and provide you a possible solution.

Regards

Vigneshkumar R



DM Dmitry October 26, 2015 11:31 AM UTC

In new case i need to hide it. I wrote some ugly code to hide this timeline rule. Not a right solution but works. May be help anyone.

            <Style TargetType="syncfusion:ScheduleTimeLineItemsControl">
                <Setter Property="Width" Value="0"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <Grid Loaded="Grid_Loaded"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

        private void Grid_Loaded(object sender, RoutedEventArgs e)
        {
            var grid = (Grid)sender;
            var controlGrid = (((VisualTreeHelper.GetParent((Grid)sender) as ScheduleTimeLineItemsControl).Parent as Grid).Parent as ScrollViewer).Parent as Grid;
            controlGrid.ColumnDefinitions[0].MinWidth = 0.0;
            controlGrid.ColumnDefinitions[0].Width = new GridLength(0.0);
        }

Another issue. Context menu. I added these code for hide it:
        
        private void Schedule_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
        {
            e.Cancel = true;
        }
It works, but ONLY before I change ScheduleType. AFTER changing schedule type (e.g month->week) event trigger not fire and menu appear.

Why not use a dependency boolean property to show/hide context menu. I prefer mvvm pattern for development, but is a very difficult to use it with SfSchedule control.


VR Vigneshkumar Ramasamy Syncfusion Team October 27, 2015 12:05 PM UTC

Hi Dmitry,

Please follow-up with the incident which is created for this forum for further assistance.

Link: https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents/incidents/newincident

Regards

Vigneshkumar R


Loader.
Up arrow icon