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
75
Change the image based on condition
posted


<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..