Hi,
Conditional formatting on Boolean data.
Requirement : We have one column in xamgrid which will bind to some boolean data. We have to display specific image according to data i.e. either true or false.
We have used conditional formatting as below but it is not displaying image as per data. Please let us know the solution.
<ig:TemplateColumn Key="Status" Width="60">
<ig:TemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Source={StaticResource ResourceNames},Path=MSG_SD_Status}"/>
</DataTemplate>
</ig:TemplateColumn.HeaderTemplate>
<ig:TemplateColumn.ItemTemplate>
<TextBlock Text="{Binding Status}" />
</ig:TemplateColumn.ItemTemplate>
<ig:TemplateColumn.ConditionalFormatCollection>
<ig:IconConditionalFormatRule RuleExecution="AfterFilteringAndPaging" IsTerminalRule="True">
<ig:IconConditionalFormatRule.Rules>
<ig:ConditionalFormatIcon ValueType="Number" Value="1" Operator="GreaterThanOrEqualTo">
<ig:ConditionalFormatIcon.Icon>
<Image Source="/DecisionCenter.DashboardViewer;component/Images/Green.jpg" />
</ig:ConditionalFormatIcon.Icon>
</ig:ConditionalFormatIcon>
<ig:ConditionalFormatIcon ValueType="Number" Value="0" Operator="GreaterThan">
<Image Source="/DecisionCenter.DashboardViewer;component/Images/CIRCLE4B.PNG" />
</ig:IconConditionalFormatRule.Rules>
</ig:IconConditionalFormatRule>
</ig:TemplateColumn.ConditionalFormatCollection>
</ig:TemplateColumn>
Thanks
IconConditionFormatRule can only be used on numeric data (more about the different types of rules). It cannot be used on boolean data.
Regards
To do this you would probably be better off putting two image tags in the ItemTemplate of the Template column, one for each image and tying the Visiblity property of the images to your data object through a value converter.
Hello,
Were you able to resolve your issue using the converter?
Sincerely,ValerieDeveloper Support Engineer Infragisticswww.infragistics.com/support