Hello,
I have some cells I want to mark if they have particular values. I have taken a look at the example but I am no able to fully grasp this and use it for my project. The problem is, that I don't set any fields in xaml but dynamically in the code. I tried to just use the InitializeRecord-Event and set the style "by hand", but this does not work:
void EvaluationList_InitializeRecord(object sender, Infragistics.Windows.DataPresenter.Events.InitializeRecordEventArgs e) { if (e.Record is DataRecord) { if (typeOfData == "A" || typeOfData == "B") { if (Convert.ToInt32(e.Record.Cells[FieldNames.NOLTL].Value) > 0) { e.Record.Cells[FieldNames.LTL].Field.Settings.CellValuePresenterStyle = this.ViolationsCellStyle; } } } }
The ViolationsCellStyle is set in the xaml resource:
<DockPanel.Resources> <Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="violationsFieldStyle"> <Setter Property="Foreground"> <Setter.Value> <SolidColorBrush Color="Red" /> </Setter.Value> </Setter> </Style> </DockPanel.Resources>
I hope you can tell me what I am doing wrong here.
I am using v.10.1.
I assume you are trying to create a conditional formatting of your own. Here is blog post form our website showing how you can do it: http://blogs.infragistics.com/blogs/alex_fidanov/archive/2010/01/12/howto-using-wpf-converters-to-style-the-xamdatagrid.aspx
Please let me know if you require nay further assistance on the matter.
Sincerely,
Petar Monov
Developer Support Engineer
Infragistics Bulgaria
www.infragistics.com/support