Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
506
XamCheckEditor problem
posted

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>