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

Change value of Selection Range Title

2 Answers 95 Views
TimeBar
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 13 Jan 2020, 03:00 PM

Hey,

I have a TimeBar which displays data within a visible time range of several hours and has a max selection range of 30 minutes. Thus I want to change the Date displayed in the Selection Range Title from "MM/dd/yyyy" to "dd.MM.yyyy HH:mm:ss". How can this be achieved?

Example code:

<telerik:RadTimeBar IsSnapToIntervalEnabled="False"
                                            PeriodStart="{Binding AnalysisDetailPeriodStart, Mode=TwoWay}" PeriodEnd="{Binding AnalysisDetailPeriodEnd, Mode=TwoWay}" VisiblePeriodStart="{Binding AnalysisDetailVisiblePeriodStart, Mode=TwoWay}" VisiblePeriodEnd="{Binding AnalysisDetailVisiblePeriodEnd, Mode=TwoWay}"
                                            SelectionStart="{Binding AnalysisDetailSelectedStart, Mode=TwoWay}" SelectionEnd="{Binding AnalysisDetailSelectedEnd, Mode=TwoWay}" MaxSelectionRange="{Binding AnalysisDetailMaxSelectionRange, Mode=OneWay}">

                        <telerik:RadTimeBar.Resources>
                            <utils:HourFormatterProvider x:Key="HourFormatterProvider"/>
                        </telerik:RadTimeBar.Resources>

                        <telerik:RadTimeBar.Intervals>
                            <telerik:MinuteInterval  />
                            <telerik:HourInterval FormatterProvider="{StaticResource HourFormatterProvider}" />
                            <telerik:DayInterval />
                        </telerik:RadTimeBar.Intervals>

                        <telerik:RadLinearSparkline ItemsSource="{Binding ObservableData}" XValuePath="Date" YValuePath="Occurrences" />
                    </telerik:RadTimeBar>

2 Answers, 1 is accepted

Sort by
0
Accepted
Vladimir Stoyanov
Telerik team
answered on 16 Jan 2020, 12:09 PM

Hello Andy,

Can you give the SelectionTitleFormatString property of the RadTimeBar a try and let me know, if that is what you were going for? Here is what I have in mind:

<telerik:RadTimeBar SelectionTitleFormatString="{}{0:dd.MM.yyyy HH:mm:ss} - {1:dd.MM.yyyy HH:mm:ss}" />

I am looking forward to your reply.

Regards,
Vladimir Stoyanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Andy
Top achievements
Rank 1
answered on 16 Jan 2020, 12:20 PM

Hello Vladimir,

your solutions works as intended. This was far easier than expected. Thanks!

Regards,

Andy

Tags
TimeBar
Asked by
Andy
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
Andy
Top achievements
Rank 1
Share this question
or