Click here to Skip to main content
15,888,521 members

Comments by Supriya Srivastava (Top 1 by date)

Supriya Srivastava 2-Jul-14 4:13am View    
Ur code was bit helpful for me to some extend but as I mentioned before I need click event on Image click. I did the below:
<textblock text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type DataGrid}}, Path=Columns[22].Header}">

<Button Name="btnYieldFilter" Margin="3,0,0,0" Click="btn_Click" >
<Button.Template>
<controltemplate>
<Image IsHitTestVisible="True" Height="10" Width="10" VerticalAlignment="Center" Source="/..Image.png" Margin="0" KeyboardNavigation.IsTabStop="False"/>

</Button.Template>
</Button>
I have added this style in Resource dictionary due to some constraints in my project but his is throwing error as "'ResourceDictionary' root element requires a x:Class attribute to support event handlers in the XAML file. Either remove the event handler for the Click event, or add a x:Class attribute to the root element."
so can you please help me how to set click event in code behind or in resource dictionary.

Thanks!!