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
380
Change Fore Color
posted

Hi 

I net to change the fore color of a cell value if the value is over 100. I create all of my fields ar not created in the xaml.  I create the fields at the FieldLayoutInitialized event handler. 

Dim oHookUtilizationField As New Field With {.Name = HOOKUTILIZATION, .Label ="Utilization", Column = 2, .Row = 1, .Width = m_oColumnWidth}

e.FieldLayout.Fields.Add(oHookUtilizationField)

 

Now i need to change the fore color of this field if the value is over 100 i have only found xaml solution for my problem like this:

<igDP:Field.Settings>

        <igDP:FieldSettings EditorType="{x:Type igEditors:XamCurrencyEditor}" EditAsType="{x:Type System:Double}">

          <igDP:FieldSettings.EditorStyle>

            <Style TargetType="{x:Type igEditors:ValueEditor}">

              <Style.Setters>

                <Setter Property="ValueConstraint">

                  <Setter.Value>

                    <igEditors:ValueConstraint MinInclusive="0" MaxInclusive="100" />

                  </Setter.Value>

                </Setter>

                <Setter Property="InvalidValueBehavior" Value="RetainValue" />

              </Style.Setters>

              <Style.Triggers>

                <Trigger Property="IsValueValid" Value="false">

                  <Trigger.Setters>

                    <Setter Property="ForeColor" Value="Red" />

                  </Trigger.Setters>

                </Trigger>

              </Style.Triggers>

            </Style>

          </igDP:FieldSettings.EditorStyle>

        </igDP:FieldSettings>

      </igDP:Field.Settings>

I need this code at the FieldLayoutInitialized event handler.