We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Howto customize template for ScheduleDaysView

Thread ID:

Created:

Updated:

Platform:

Replies:

120826 Oct 20,2015 07:55 AM Oct 27,2015 08:05 AM WinRT 5
loading
Tags: SfSchedule
Dmitry
Asked On October 20, 2015 07:55 AM

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?

Vigneshkumar Ramasamy [Syncfusion]
Replied On October 21, 2015 09:24 AM

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


Dmitry
Replied On October 23, 2015 07:20 AM

Thank you.

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



Vigneshkumar Ramasamy [Syncfusion]
Replied On October 26, 2015 04:45 AM

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


Dmitry
Replied On October 26, 2015 07:31 AM

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.

Vigneshkumar Ramasamy [Syncfusion]
Replied On October 27, 2015 08:05 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;