Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Timetable Columns Subheader (Read 2116 times)
Nika
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 7
Joined: Oct 11th, 2018
Timetable Columns Subheader
Dec 14th, 2018 at 11:06am
Print Post  
Hello!

I would like to edit the text of the subheaders of each column (timetable view), but all I can find ist just how to style the subheaders. Is there a possibility to do that, or do I have to implement my own control above the calendar?

Thanks for your answer in advance!
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Timetable Columns Subheader
Reply #1 - Dec 14th, 2018 at 3:00pm
Print Post  
Hi,

You can use the TimetableSettings.ColumnSubheaderTemplate to apply a template that fits your requirements, adding, for example, a custom value converter. Something like:

Code
Select All
        <planner:Calendar x:Name="calendar" CurrentView="Timetable" Theme="Silver">
            <planner:Calendar.TimetableSettings>
                <planner:TimetableSettings>
                    <planner:TimetableSettings.ColumnSubheaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Text, Converter={StaticResource myConverter}}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                        </DataTemplate>
                    </planner:TimetableSettings.ColumnSubheaderTemplate>
                </planner:TimetableSettings>
            </planner:Calendar.TimetableSettings>
        </planner:Calendar> 


Code
Select All
	public class MyConverter : IValueConverter
	{
		public object Convert(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			if (value is string)
				return string.Format("< {0} >", value.ToString());

			return "";
		}

		public object ConvertBack(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			throw new NotSupportedException();
		}
	} 



Regards,
Lyubo
  

customsubheader.PNG ( 3 KB | 206 Downloads )
customsubheader.PNG
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint