Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Docking > Programmatic HeaderTemplateSelector in RadPane not working

Not answered Programmatic HeaderTemplateSelector in RadPane not working

Feed from this thread
  • Stephan avatar

    Posted on Oct 18, 2011 (permalink)

    Is there any reason why my selector is never called when I do the following:

    RadPane pane = new RadPane();
    pane.HeaderTemplateSelector = new HeaderTemplateSelector();

    Setting a breakpoint in "SelectTemplate" shows, that it is never called and consequently the tab (header) is eventually empty. I get the same issues when programmatically setting the HeaderTemplate property instead of the HeaderTemplateSelector.


    Is this a known bug or am I doing something wrong?

    Regrads,
    Stephan

    Reply

  • Miroslav Nedyalkov Miroslav Nedyalkov admin's avatar

    Posted on Oct 21, 2011 (permalink)

    Hi Stephan,

    Thank you for reporting us this issue - I logged in PITS where you can track its progress. Your Telerik points were updated for your cooperation.

    Regards,
    Miroslav Nedyalkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Sascha avatar

    Posted on Feb 6, 2012 (permalink)

    Hello,

    the Entry in PITS is in the wrong catory and is canceled, but the bug still exists in Silverlight RadControls for Silverlight, v.2011.3.1205.1040.

    Any news regarding this bug?


    Regards,
    Sascha


    Reply

  • Stephan avatar

    Posted on Feb 8, 2012 (permalink)

    I'm also still interested in this issue. When will this be fixed? Any news?

    Just tried again to set the pane's Header to my viewmodel and the pane's HeaderTemplateSelector to my DataTemplateSelector implementation. No success! :-(


    Thank you,
    Stephan

    Reply

  • Tina Stancheva Tina Stancheva admin's avatar

    Posted on Feb 15, 2012 (permalink)

    Hi guys,

    The item in PITS is cancelled since the issue is related to the RadTabItem from which the RadPane control derives.

    Basically in Silverlight the only way to apply a HeaderTemplateSelector property to a RadTabItem is to bind the ItemsSource of the RadTabControl and set the ItemContainerStyle property to apply a style setter setting the HeaderTemplateSelector property to the RadTabItems containers.

    In Silverlight you can't manually apply a HeaderTemplateSelector property to a RadTabItem by setting the RadTabItem.HeaderTemplateSelector property because the ContentPresenter used to represent the header content of the items doesn't support such a property and this is why the property value cannot be directly propagated. But as this is an expected behavior and not a supported scenario in the RadTabControl, we won't be looking for fixes at the moment.

    Please accept our apology for this inconvenience.

    Greetings,
    Tina Stancheva
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

  • Sascha avatar

    Posted on Feb 15, 2012 (permalink)

    OK,

    so I tried this one:


    <telerik:RadPane x:Name="paneFilterMenu"
    	Width="Auto"
    	HorizontalContentAlignment="Stretch"
    	VerticalContentAlignment="Stretch"
    	AllowDrop="True"
    	CanDockInDocumentHost="false"
    	CanFloat="False"
    	CanUserClose="False"
    	CanUserPin="True"
    	Header="{Binding DataContext.SelectedItem.Content.ViewContent.DataContext,
    		ElementName=LayoutRoot}"
    		HeaderTemplate="{StaticResource CISHeaderTemplateMenu}"
    		IsPinned="{Binding DataContext.IsMenuPanePinned,
    			ElementName=LayoutRoot,
    			Mode=TwoWay}">
    
    The HeaderTemplate shows from the ViewContent.DataContext a Picture and a caption.
    This works fine, if the pane is unpinned, on the left I can see the picture and the caption.
    
    But, if the pane is pinned, the headertemplate is ignored and only the objectname of the ViewContext.DataContext is displayed.
    
    I've attached two images of this behavior.
    
    So, how to correct this one?
    
    Regards,
    Sascha

    Reply

  • Stephan avatar

    Posted on Feb 15, 2012 (permalink)

    @Tina: Well, thanks for your answer. Not what I wanted to hear but ok ... :-)

    @Sacha: I haven't had a detailed look at your xaml but looking at your images I think you mix up RadPane's Header and Title property. The header of a RadPane is used as tab content whenever there are is more than one pane in a pane group or e.g. when the pane is unpinned (RightDisplay.png). The title of a RadPane is shown in the RadPaneGroup's "titlebar" whenever the pane is active in that group (WrongDisplay.png). As far as I remember the Title property is always rendered as string (look at the sources) even though you set it to a UIElement. So there might be no chance to display an icon here.

    I just had a look at the sources of RadPane:

    private static void OnTitlePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs args)
    {
        if (args.NewValue is UIElement)
        {
            d.SetValue(RadPane.TitleProperty, args.NewValue.ToString());
        }
    }


    @Tina: Is there any reason why the title is restricted to string???

    Reply

  • Sascha avatar

    Posted on Feb 16, 2012 (permalink)

    Hello Stephan,

    thanks for your hint. I've only used the Header Property, the Title was never set. And without Headertemplate and the Header bound to a string you never see a difference between the title and the header.

    But now, I've bound the Header to an object with two properties (Image and Caption) and assigned the header Template.
    In this case, the Header works, but the Title not.

    I've assigned the "CISHeaderTemplateMenu" to the TitleTemplate Property, now the TitleBar is correct.

    Thanks,

    Sascha

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Docking > Programmatic HeaderTemplateSelector in RadPane not working
Related resources for "Programmatic HeaderTemplateSelector in RadPane not working"

Silverlight Docking Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]