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
360
Problem with Alternate Record Backgrounds for CellValuePresenter
posted

How do I create an alternate record background for a CellValuePresenter Style?

I tried creating it via a Style Trigger as so:

<Style x:Key="myCell" TargetType="igDP:CellValuePresenter">
      <Setter Property="Background" Value="LightGray" />
      <Style.Triggers>
        <Trigger Property="IsAlternate" Value="True">
          <Setter Property="Background" Value="Green" />
        </Trigger>
        <Trigger Property="IsAlternate" Value="False">
          <Setter Property="Background" Value="LightGray" />
        </Trigger>
      </Style.Triggers>
    </Style>

When scrolling, the alternate rows show up, but they are not consistent .. some colors are grouped together, rather than being every other row. The alternate rows do not show up at all when the grid is first loaded.

Parents
No Data
Reply
  • 27093
    posted

    Hello Joseph,

    I have been looking into your issue and have to say that this is not the intended way of coloring the alternate Records. Here is xaml snippet showing how you can easily assign these colors by styling the DataRecordCellArea:

    <Style TargetType="{x:Type igDP:DataRecordCellArea}">

        <Setter Property="Background" Value="Gray"/>

        <Setter Property="BackgroundAlternate"  Value="Green" />

        <Setter Property="BorderBrush" Value="Blue" />

        <Setter Property="BorderAlternateBrush" Value="Yellow"/>

    </Style>

    If there is a reason you need to do this using the CellValuePresenter please let me know what it is I can provide you with a more specific solution.

    Sincerely,

    Petar Monov

    Developer Support Engineer

    Infragistics Bulgaria

    www.infragistics.com/support

Children