My problem is that I am wanting to use 1 data template for multiple colums in a gridview, but I want to bind the element in the data template to a different path.
In the example below I have a template that creates a checkbox.
| <Grid.Resources> |
| <Style x:Key="CheckboxCellStyle" TargetType="{x:Type telerik:GridViewCell}"> |
| <Setter Property="ContentTemplate"> |
| <Setter.Value> |
| <DataTemplate> |
| <CheckBox VerticalAlignment="Center" IsChecked="{Binding ????}" Click="CheckBox_Click" /> |
| </DataTemplate> |
| </Setter.Value> |
| </Setter> |
| </Style> |
| </Grid.Resources> |
I want to bind the IsChecked property to the binded element in the data colulmn definition.
| <telerik:GridViewDataColumn Header="Deleted" DataMemberBinding="{Binding Deleted}" CellStyle="{StaticResource CheckboxCellStyle}"></telerik:GridViewDataColumn> |
| <telerik:GridViewDataColumn Header="Selected" DataMemberBinding="{Binding Selected}" CellStyle="{StaticResource CheckboxCellStyle}"></telerik:GridViewDataColumn> |
Can someone please help me find a solution to this problem?