locked
RelativeSource Binding inside EventTrigger not working RRS feed

  • Question

  • Hi,

    I have a Dropdown button whose dropdown content contains Border and a button inside that border.

    I have attached a EventTrigger on Click event of the Button like this

    <i:EventTrigger EventName="Click">
              <ei:ChangePropertyAction
              TargetObject="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=telerik:RadDropDownButton}}"
              PropertyName="IsOpen" Value="False"/>
    </i:EventTrigger>

    Basically, I want to close the dropdown on click of this button.

    FYI: If I specify Elementname in my TargetObject binding, it works fine. But this will defeat the whole purpose of Templates.

    Thank you for your help

    Sameer

    Tuesday, March 20, 2012 11:58 PM