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
3305
DataTrigger is not firing
posted

I have this code set up for my XamGrid

 <Grid.Resources >

<Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key

 

="BoolFieldOverride">

<

 

Setter Property="Template">

 

<Setter.Value>

<

 

ControlTemplate TargetType="{x:Type igDP:CellValuePresenter }">

<

 

CheckBox HorizontalAlignment="Center" VerticalAlignment ="Center"

 

 

IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path

=Content}"/>

</

 

ControlTemplate>

</S

 

etter.Value>

</

 

Setter>

<

 

Style.Triggers>

<

 

DataTrigger Binding="{Binding 

 

 

 

 

 

RelativeSource={RelativeSource Self}, Path=Record.DataItem.Count}" Value

="0">

<

 

Setter Property="IsEnabled" Value="False" />

</

 

DataTrigger>

</

 

Style.Triggers>

</

 

Style>

</

 

Grid.Resources>

 

 

 

 

 

my grid column 

 

<

 

igDP:Field Name="Active" Column="0" Label="Active" >

<

 

igDP:Field.Settings>

<

 

igDP:FieldSettings CellWidth="60" LabelMaxWidth="60" CellMaxWidth="60" CellValuePresenterStyle="{StaticResource BoolFieldOverride}" />

</

 

igDP:Field.Settings>

</

 

igDP:Field>

 

 

 

 

 

 

 

 

everything seems to be working but when my grid loads and the Count field=0

the check box is still enabled??

what am I missing here.

 

Parents
  • 3305
    posted

    got it fixed (thanks to another post on here)

    I changed the datatrigger binding path to

     

     

     

     

    <

     

    Style.Triggers>

    <DataTrigger Binding="{Binding Path=Cells[4].Value}" Value="0">

    <

     

    Setter Property="IsEnabled" Value

    ="False" />

    </

     

    DataTrigger>

    </

     

    Style.Triggers>

    and now it works.

Reply Children
No Data