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

RelativeSource Binding inside EventTrigger not working

0 Answers 166 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sameer
Top achievements
Rank 1
Sameer asked on 21 Mar 2012, 01:00 AM

Hi,

I have a RadDropDownButton whose dropdown content contains Border and a RadButton inside that border.

I have attached a EventTrigger on Click event of the RadButton 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

 

Tags
General Discussions
Asked by
Sameer
Top achievements
Rank 1
Share this question
or