Is there any way I can display the text in a particular cell with Bold text based on the value of another cell in the same row ? I.e I have a IsDefault cell and if this is set tro 1 I would like another cell to be displayed with different formatting.
Many Thanks
Niclas
Hi Alex. I have tried all I know this afternoon. It looks ok to me. There is a field in the datasource "CareUnit" I have made sure its trimmed. It can either be "ICU" or "HDU" - please if you have any ideas I'd be stoked! Thanks
<Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="UserImage1"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}"> <Grid Width="50" Height="50"> <Image x:Name="myImage" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Source="{DynamicResource BuddyYellow}"> </Image> </Grid> <ControlTemplate.Triggers> <DataTrigger Binding="{Binding Path=Record.DataItem.CareUnit}" Value="ICU" > <Setter TargetName="myImage" Property="Image.Source" Value="{DynamicResource BuddyBlue}"/> </DataTrigger> <DataTrigger Binding="{Binding Path=Record.DataItem.CareUnit}" Value="HDU" > <Setter TargetName="myImage" Property="Image.Source" Value="{DynamicResource BuddyBlue}"/> </DataTrigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style>
Hi Alex
Could you please help me with the syntax? I have been having trouble. This is the CVP style
<Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="UserImage1">
="Template">
>
}">
="50">
="BuddyImage"
}"
}"/>
Thank you I will give this a shot tomorrow
If you have only couple of scenario when you want to change the image, then it would be better to use triggers than IValueConverter. What you can do is to create a DataTrigger or a Trigger inside the control template of the CVP. It will bind to the CVP's Value property or the Record.DataItem.PropertyName and based on the value (1,2,3,4) create a setter that changes the Source property of the Image.
The example is attached to this post test.zip. What I need to do is based on a value in a cell, for example a status (1,2,3,4) or (Complete, Failed, Processing) display a different image based on this value in an unbound field.
For example if Complete, the image would be a tick icon, failed and cross icon type thing. I have done this a lot in .NET by calling a function when the field is bound to select the correct image source based on a cells value.
Hope that makes sense? I am using 9.1
Thanks