Binding controls w/i RadRibbonDropDownButton.DropDownContent

3 posts, 1 answers
  1. Mike
    Mike avatar
    5 posts
    Member since:
    Oct 2011

    Posted 23 Jan 2012 Link to this post


    I'm having a problem with the following code:
        <StackPanel >
            <StackPanel Orientation="Horizontal" x:Name="LayoutRoot">
                <ListBox Name="ListBox" ItemsSource="{Binding Path=Columns, ElementName=TableGrid}">
                            <CheckBox Content="{Binding Header}"
                                IsChecked="{Binding IsVisible, Mode=TwoWay}" />
                <telerik:RadGridView Name="TableGrid" ItemsSource="{Binding Units}" ShowGroupPanel="False" />
    This is the "Showing and hiding radgrid columns outside the radgrid" example from the Telerik website, in a dropdowncontent.  When I run this and set the datacontext, "TableGrid" shows data properly but "ListBox" does not show the column headers.  If I take the "LayoutRoot" stackpanel up a level, out of the radribbonbutton and into the radribbongroup driectly, it works fine ("ListBox" contains the "TableGrid" headers.)  Poking around I've read that that the dropdowncontext doesn't share the same visual tree as the parent, but I would think I could bind controls from within the dropdowncontext.  Can you point me in the right direction to resolve this please?

  2. Answer
    Petar Mladenov
    Petar Mladenov avatar
    2882 posts

    Posted 26 Jan 2012 Link to this post

    Hello Mike,

     The behavior you have come up with is Expected. When a Popup is part of a Template (in this case there is the Popup in the DropDownContent) the child elements of the Popup "do not see" each other. This is limitation framework and you can also examine the same behavior when using the DropDownButton from the Extended WPF 4 Toolbox.
    However, I think there is a suitable workaround, you can check it out in the attachment. I used Button and on its Click I open a Popup. This way the Popup is not in a Template and its children "play well" together. Please let us know if this is suitable for you.

    Petar Mladenov
    the Telerik team

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

  3. DevCraft R3 2016 release webinar banner
  4. Mike
    Mike avatar
    5 posts
    Member since:
    Oct 2011

    Posted 29 Jan 2012 Link to this post

    This is very helpful.  Thank you.
Back to Top