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
450
FieldLayout settings for Dynmaic fields
posted

Hello, How can I apply style for dynamic fields.

I wont know the number of columns, until runtime. But, I want to format columns based on its type.. Ex: If the value is Deceimal change Foreground based on its value.

I thought of applying Style for all the columns, and Converter has the logic to identity whether the value is of certain type. Below code doesnt work ..

<Style TargetType="{x:Type igDP:CellValuePresenter}">
<Setter Property="Foreground" Value="{Binding Path=Value, Converter={StaticResource ResourceKey=fontcolorConverter}}" /></Style>

System.Windows.Data Error: 40 : BindingExpression path error: 'Value' property not found on 'object' ''DataRecord' (HashCode=39116207)'. BindingExpression:Path=Value; DataItem='DataRecord' (HashCode=39116207); target element is 'CellValuePresenter' (Name=''); target property is 'Foreground' (type 'Brush')

Any ideas?