Hi There,
I am having issue with changing foreground color in Grid. Here is the partial code,
=====================================================================
<igDP:XamDataGrid Name="_dataGrid" Grid.Row="1" DataSource="{Binding}" Theme="[Current]"> <igDP:XamDataGrid.Resources> <local:OrderTypeConvertor x:Key="orderTypeConvertor"/>
<Style TargetType="{x:Type igDP:DataRecordPresenter}"> <Setter Property="Foreground" Value="White" /> <Setter Property="Background" Value="{Binding Path=Cells[Quantity].Value, Converter={StaticResource orderTypeConvertor}}" /> </Style>
</igDP:XamDataGrid.Resources> <igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings AutoGenerateFields="False" AllowDelete="False" HighlightAlternateRecords="False" /> </igDP:XamDataGrid.FieldLayoutSettings> <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:Field Name="UserId" Label="UserId" Width="60" /> ................ <igDP:Field Name="Quantity" Label="Quantity" Width="70" /> ................. <igDP:Field Name="ApplicationId" Label="ApplicationId" Width="100" /> .............. .............. </igDP:FieldLayout.Fields> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts></igDP:XamDataGrid>
===========================================================
It does change background color, but not foreground color. I just want to set foreground (text) color to wrhite instead of default, which is black.
I'm sure I must be missing something simple.
Please let me know.
Thanking in advance for your help.
Hello,
I have been looking into your post and I can suggest you use CellValuePresenter instead of DataRecordPresenter :
http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.CellValuePresenter.html
If you need any further assistance on this matter, feel free to ask.
In my case I need to use DataRecordPresenter since the whole row must be formatted based on one column's value. Using the CellValuePresenter doesn't give me access to other column's values, right? So why is the DataRecordPresenter not accepting the Foreground color?