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

TimeSpanWatermarkContent does not work within listbox ItemTemplate

2 Answers 46 Views
TimeSpanPicker
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 2
Martin asked on 13 Feb 2018, 03:05 PM

Hello there,

I am using the TimeSpanPicker within a ListBox ItemTemplate. I am changing the watermark. This works prefectly outside the template but when in a template does not work at all , my string is ignored and the default is used. I have also tried to use DynamicResource but found the same issue.

I have made a very simple project which highlights the issue, it uses the latest UI for WPF from the website.

It can be found here : https://www.dropbox.com/s/3ijhj346w0pjg1f/Telerik%20bug.zip?dl=0 

Also attached a screenshot showing the program running.

Thanks,

Martin

2 Answers, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 16 Feb 2018, 09:28 AM
Hello Martin,

Thank you for sharing the issue. I can confirm this is a bug in the control so I logged it in our feedback portal. I also updated your Telerik points.

As a workaround you can set the TimeSpanWatermarkTemplate property.
<ListBox.ItemTemplate>
    <DataTemplate>
        <telerik:RadTimeSpanPicker>
            <telerik:RadTimeSpanPicker.TimeSpanWatermarkTemplate>
                <DataTemplate>
                    <TextBlock Text="blah blah" />
                </DataTemplate>
            </telerik:RadTimeSpanPicker.TimeSpanWatermarkTemplate>
        </telerik:RadTimeSpanPicker>
    </DataTemplate>
</ListBox.ItemTemplate>
Can you please give this approach and let me know if it helps?

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Martin
Top achievements
Rank 2
answered on 16 Feb 2018, 11:12 AM

Hi Martin,

Thank you, the workaround does work and works with DynamicResource as well.

Thanks again,

Martin

Tags
TimeSpanPicker
Asked by
Martin
Top achievements
Rank 2
Answers by
Martin Ivanov
Telerik team
Martin
Top achievements
Rank 2
Share this question
or