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
200
Xam Data tree
posted

Hello,

I am using following code to use regular checkbox in wpf rather than Infragistics themed checkbox, it works but

CheckBoxMode Auto is not working.

<Setter Property="CheckBoxStyle">

<Setter.Value>

<Style TargetType="{x:Type CheckBox}">

<Setter Property="Template">

<Setter.Value>

<ControlTemplate TargetType="{x:Type CheckBox}">

<CheckBox/>

</ControlTemplate>

</Setter.Value>

</Setter>

</Style>

</Setter.Value>

</Setter>

Is it something I am missing here?

Parents
  • 2155
    Verified Answer
    Offline posted

    Hello Sameer,

    You should be able to get CheckBoxMode=Auto setting working if you bind your CheckBox’s IsChecked property to its parent property like below.

    <Style TargetType="{x:Type CheckBox}">
     <Setter Property="Template">
      <Setter.Value>
       <ControlTemplate TargetType="{x:Type CheckBox}">
        <CheckBox IsChecked="{Binding IsChecked, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"/>
       </ControlTemplate>
      </Setter.Value>
     </Setter>
    </Style>

    I have attached the sample.

    Let me know if I may be of further assistance.

    Thank you,
    Mihoko Kamiishi

    CASE-180461.zip
Reply Children
No Data