Hi,
I have what I think is a fairly simple scenario. Instead of having the Background colour alternating on my rows I would like to keep this constant and have the Foreground style change instead. All the existing posts I've read seem to focus on Background and it appears that Foreground isn't working in the same way.
With the following xaml all my rows look the same, am I doing something wrong?
<Window x:Class="Infragistics.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dataPresenter="http://infragistics.com/DataPresenter"
Title="MainWindow"
Height="350" Width="525">
<Window.Resources>
<SolidColorBrush x:Key="DefaultBackground" Color="#FF3D3C3C" />
<SolidColorBrush x:Key="DefaultForeground" Color="Ivory" />
<Style x:Key="XamDataGridForegroundStyle" TargetType="{x:Type ContentPresenter}">
<Setter Property="TextBlock.Foreground" Value="{StaticResource DefaultForeground}"/>
</Style>
<Style x:Key="XamDataGridAlternateForegroundStyle" TargetType="{x:Type ContentPresenter}">
<Setter Property="TextBlock.Foreground" Value="Red"/>
<Setter Property="TextBlock.FontStyle" Value="Italic"/>
</Window.Resources>
<Grid Background="{StaticResource DefaultBackground}">
<dataPresenter:XamDataGrid DataSource="{Binding People}"
Background="{StaticResource DefaultBackground}">
<dataPresenter:XamDataGrid.Resources>
<Style TargetType="{x:Type dataPresenter:DataRecordCellArea}">
<Setter Property="Background" Value="{StaticResource DefaultBackground}" />
<Setter Property="BackgroundAlternate" Value="{StaticResource DefaultBackground}" />
<Style TargetType="{x:Type dataPresenter:CellValuePresenter}">
<Setter Property="ForegroundStyle" Value="{StaticResource XamDataGridForegroundStyle}" />
<Setter Property="ForegroundAlternateStyle" Value="{StaticResource XamDataGridAlternateForegroundStyle}" />
</dataPresenter:XamDataGrid.Resources>
<dataPresenter:XamDataGrid.FieldSettings>
<dataPresenter:FieldSettings />
</dataPresenter:XamDataGrid.FieldSettings>
<dataPresenter:XamDataGrid.FieldLayoutSettings>
<dataPresenter:FieldLayoutSettings HighlightAlternateRecords="True" />
</dataPresenter:XamDataGrid.FieldLayoutSettings>
</dataPresenter:XamDataGrid>
</Grid>
</Window>
Thanks,
Steve
Hello Steve,
I have logged this with development under ID: 142490 and I have also created a support ticket on your behalf: CAS-116452-Y5L5K6 and have linked the development issue to it, so that you can get automatically updated, when a Service Release containing the fix is available for download. You can get the new version from our website’s “My IG”, “My Keys & Downloads” tags: https://es.infragistics.com/Membership/Default.aspx?panel=Downloads#Downloads
You can also monitor the support ticket’s progress through the “My Support Activity” tag: https://es.infragistics.com/Membership/MySupport.aspx
Meanwhile you can use the sample I attached, where I used Trigger in order to change the Foreground.
Hi Stefan,
Thanks very much for this - your DataTrigger works a treat.
Regards,
We have shipped out a new service release where your issue is resolved. I'd be glad to find out if you had tested it out and if it had met your requirements.
You can download the Service Releases by logging to our web site and going to Account \Keys & Downloads.
https://es.infragistics.com/my-account/keys-and-downloads/