Hi
I am using wpf grid view as shown below.
<telerik:RadGridView Grid.Row="1" ItemsSource="{Binding ExistingFilesCollection}" CanUserDeleteRows="False" CanUserFreezeColumns="False" CanUserGroupColumns="False" CanUserInsertRows="False" CanUserReorderColumns="False" CanUserSearch="False" ShowGroupPanel="False" IsFilteringAllowed="False"
AutoGenerateColumns="False" SelectionMode="Extended" Margin="0,10,0,0" GridLinesVisibility="Both" RowIndicatorVisibility="Collapsed">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Selected, Mode=TwoWay}" IsSortable="False">
<telerik:GridViewDataColumn.Header>
<StackPanel>
<CheckBox IsChecked="{Binding DataContext.SelectAll, ElementName=ExistingFilePopUpRoot,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
</telerik:GridViewDataColumn.Header>
<telerik:GridViewColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding Selected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type Grid},AncestorLevel=4}, Path=DataContext.CheckBoxEvent}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType={x:Type Grid},AncestorLevel=4}, Path=DataContext}" />
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
</telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
I don't want to use GridviewCheckboxcolumn or select column since it doesn't fit my requirement.
Now the issue is when I do databinding based on element name it fails but as shown above based on ancestor level it works.
Is there a way I can do command binding based on elementname?