Hi,
I've a problem with a XamCheckEditor.
In an unbound field I need a Checkbox with the standard event of the datagrid (cell changed, ...).
I retemplate the CellValuePresenter for the unbound field and I put in the code <ContentPresenter x:Name="PART_EditorSite"/> to hangs up the events.
But If I run the application i see the checkbox, but there is the text false/true near the checkbox.If I uncomment the PART_EditorSite the false/true text disappers, but as I aspected the events disappear too. What's my mistake?
<Style x:Key="visualizzaWebCheckBoxStyle" TargetType="{x:Type DataPresenter:CellValuePresenter}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type DataPresenter:CellValuePresenter}"> <StackPanel Orientation="Horizontal"> <Editors:XamCheckEditor HorizontalAlignment="Center" VerticalAlignment="Center" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay, Path=Value}" IsHitTestVisible="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsEditingAllowed}"/> <ContentPresenter x:Name="PART_EditorSite"/> </StackPanel> </ControlTemplate> </Setter.Value> </Setter> </Style>
Hello,
The recommended approach to add a check box to the XamDataGrid is to use the XamCheckEditor as the editor for the field rather than retemplating the CellValuePresenter. There are more detail in the Using xamCheckEditor as a Field in xamDataGrid topic in the help:
http://help.infragistics.com/NetAdvantage/WPF/2010.3/CLR4.0/?page=xamCheckEditor_Using_xamCheckEditor_as_a_Field_in_xamDataGrid.html
Let me know if you have any questions regarding this.