Setting SelectorHeader from code-behind

2 posts, 0 answers
  1. Siebe
    Siebe avatar
    1 posts
    Member since:
    Apr 2013

    Posted 18 Apr 2013 Link to this post

    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 :-)


    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?

    Siebe Tolsma
  2. Ivaylo Gergov
    Ivaylo Gergov avatar
    661 posts

    Posted 23 Apr 2013 Link to this post

    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.


    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.
  3. DevCraft banner
Back to Top