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

Setting SelectorHeader from code-behind

1 Answer 55 Views
DatePicker and DateSelector
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Siebe
Top achievements
Rank 1
Siebe asked on 18 Apr 2013, 08:27 PM
EDIT: Sorry, I accidentally posted this in WP8 -- I am using the Windows 8 controls. I can't seem to find a way to move or delete the original post, though :-)

Hello,

I am initializing a new instance of a RadDatePicker from C# code (i.e. "code-behind"), like so:

var control = new RadDatePicker();
control.SelectorHeader = "Foo";
// .. etc ..

However, when I set the SelectorHeader to a string, it does not show up in the selector popup. Instead, it will essentially do .ToString() on whatever the current DataContext is. When I set the SelectorHeader via XAML, like so:

<telerik:RadDatePicker ... SelectorHeader="Foo" ... />

It does work as expected. I've also tried setting a Binding, using control.SetBinding(RadDatePicker.SelectorHeaderProperty, ...), but that also fails. How can I set the SelectorHeader from code?

Cheers,
Siebe Tolsma

1 Answer, 1 is accepted

Sort by
0
Ivaylo Gergov
Telerik team
answered on 23 Apr 2013, 04:47 PM
Hello Siebe,

Thank you for contacting us.

I did a local test with this scenario and everything is working as expected on our side. For your convenience I have attached a sample project. Can you take a look and check if it works on your side too, and if yes - can you modify it, in order to reproduce the issue?

I am looking forward to your reply.

 

Regards,
Ivaylo Gergov
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
DatePicker and DateSelector
Asked by
Siebe
Top achievements
Rank 1
Answers by
Ivaylo Gergov
Telerik team
Share this question
or