<igDP:Field Name="UserIntID" Label ="" >
<igDP:Field.Settings >
<igDP:FieldSettings AllowEdit="False" CellWidth="15" LabelWidth ="15" >
<igDP:FieldSettings.CellValuePresenterStyle >
<Style TargetType="{x:Type igDP:CellValuePresenter }">
<Setter Property ="Template"> <Setter.Value > <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter }"> <Image x:Name="img" Source="/Images/GreenStatusLight.png" Tag="{Binding Path=DataItem.UserIntID}" >
<Image.ContextMenu > <ContextMenu > <MenuItem Name="Add" Header="Create User" Click
="Add_Click" />
<MenuItem Name="Edit" Tag="{Binding Path=DataItem.UserIntID}" Header="Update User" Click
="Edit_Click"/>
<MenuItem Name="Delete" Tag="{Binding Path=DataItem.UserIntID}" Header="Delete User" Click
="Delete_Click"/>
<MenuItem Name="Seperator" Header="____________" />
</Image.ContextMenu>
<DataTrigger Binding="{Binding Path=DataItem.Status}" Value="INACTIVE">
</Image> <ControlTemplate.Triggers><MenuItem Name="Inactive" Tag="{Binding Path=DataItem.UserIntID}" Header="Set User as Inactive" Click="Inactive_Click"/>
</ContextMenu > <Setter TargetName="img" Property="Source" Value
="/Images/RedStatusLight.png" />
</ControlTemplate > </Setter.Value >
</Setter > </Style>
</igDP:FieldSettings.CellValuePresenterStyle>
</igDP:FieldSettings>
</igDP:Field.Settings>
</igDP:Field ></DataTrigger>
</ControlTemplate.Triggers> <igDP:Field Name="Status" Label="Status" > <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="False" CellHeight="20" LabelHeight="23" CellWidth="150" LabelWidth="150" /> </igDP:Field.Settings>
</igDP:Field>
Hi all,
i kept a image in Userintd field and kept a context menu in tat..
i want to chage the image color if the statusField is inactive in any row...
I did the code but the image color is not changing for status inactive rows..
Help me..
correct my code..
Hello,
I'm sending a sample project with a different implementation. Instead of switching the Visibility property you can change the Source of the image within the control template. I hope this helps.
Regards Vlad
I am attachin a sample project that changes an image according to a condition (value in another cell).
Hope this helps