- Home
- Forum
- Xamarin.Forms
- How to customize the SfSchedule Header?
How to customize the SfSchedule Header?
I am trying to display a custom header for my SfSchedule control, but I don't understand how to customize the header view in xaml.
What i want is to customize the header so that it has a back and forward arrow to navigate.
I looked at the documentation but i am not understanding how to customize the content of the header.
Basically my goal would be this, but of course i don't think that my custom xaml layout should be inside the ViewHeaderStyle tag:
<schedule:SfSchedule.ViewHeaderStyle> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="50">ColumnDefinition> <ColumnDefinition Width="*">ColumnDefinition> <ColumnDefinition Width="50">ColumnDefinition> Grid.ColumnDefinitions> <Image Source="back.png" Grid.Row="0" Grid.Column="0">Image> <Label Text="{Binding Title}" Grid.Row="0" Grid.Column="1">Label> <Image Source="forward.png" Grid.Row="0" Grid.Column="2">Image> Grid> schedule:SfSchedule.ViewHeaderStyle>
Would you be able to suggest the right way to do it?
Ideally I am looking for the equivalent of SfListView.HeaderTemplate, not a HeaderStyle:
<listview:SfListView.HeaderTemplate> <DataTemplate> DataTemplate> listview:SfListView.HeaderTemplate>
SIGN IN To post a reply.
5 Replies
GC
Ganeshamoorthy Chandramoorthy
Syncfusion Team
April 20, 2018 10:38 AM UTC
Hi Cristian,
We have checked your requirement. Currently, SfSchedule doesn’t provide data template support for header customization. We have considered and logged a feature request for the same. We will implement this feature in any of our upcoming volume release.
However, we have prepared a sample for custom header with forward and backward arrow button to navigate. Kindly find the sample below,
Sample link: Sample
Please let us know if you need further assistance on this.
Regards,
Ganeshamoorthy C
CM
Cristian Merli
April 20, 2018 04:11 PM UTC
Thank you, for some reason the solution fails to build (see Output logs below), but i see the trick you used, thanks!
1>------ Build started: Project: Sample, Configuration: Debug Any CPU ------
1>D:\Documents\Syncfusion\Sample\packages\Xamarin.Forms.2.4.0.280\build\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.targets(69,3): error MSB4061: The "XamlCTask" task could not be instantiated from "D:\Documents\Syncfusion\Sample\packages\Xamarin.Forms.2.4.0.280\build\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Build.Tasks.dll". Could not load file or assembly 'Xamarin.Forms.Build.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
1>D:\Documents\Syncfusion\Sample\packages\Xamarin.Forms.2.4.0.280\build\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.targets(69,3): error MSB4060: The "XamlCTask" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name.
2>------ Build started: Project: Sample.Android, Configuration: Debug Any CPU ------
3>------ Skipped Build: Project: Sample.iOS, Configuration: Debug iPhone ------
3>Project not selected to build for this solution configuration
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1164,2): error MSB4018: The "ResolveLibraryProjectImports" task failed unexpectedly.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1164,2): error MSB4018: System.IO.FileNotFoundException: Could not load assembly 'Sample, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1164,2): error MSB4018: File name: 'Sample.dll'
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1164,2): error MSB4018: at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1164,2): error MSB4018: at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1164,2): error MSB4018: at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(DirectoryAssemblyResolver res, ICollection`1 jars, ICollection`1 resolvedResourceDirectories, ICollection`1 resolvedAssetDirectories, ICollection`1 resolvedEnvironments)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1164,2): error MSB4018: at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute()
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1164,2): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1164,2): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
========== Build: 0 succeeded, 2 failed, 0 up-to-date, 1 skipped ==========
GC
Ganeshamoorthy Chandramoorthy
Syncfusion Team
April 23, 2018 12:53 PM UTC
Hi Cristian,
Sorry for the inconvenience caused. Please find the modified sample below,
Sample: Sample
Regards,
Ganeshamoorthy C
CM
Cristian Merli
April 24, 2018 09:25 PM UTC
Thanks
GC
Ganeshamoorthy Chandramoorthy
Syncfusion Team
April 25, 2018 04:31 AM UTC
Hi Cristian,
Thanks for the update. Please let us know if you need further assistance on this.
Regards,
Ganeshamoorthy C
SIGN IN To post a reply.
- 5 Replies
- 2 Participants
-
CM Cristian Merli
- Apr 19, 2018 11:31 PM UTC
- Apr 25, 2018 04:31 AM UTC