I'm able to change the background of a row by binding a converter to the Background property of the DataRecordCellArea:
<Style TargetType="{x:Type igPresenter:DataRecordCellArea}"> <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content, Converter={StaticResource customHighlightConverter}}"/> </Style>
I would also like to know how to change this value if code. At the moment I'm using:
RecordPresenter presenter = DataRecordPresenter.FromRecord(Records[index]); if (presenter != null) { presenter.Background = brush; }
but this changes the background behind the Cell area that i've changed via binding.
How can i get access to the DataRecordCellArea in code to be able to update the background color?
Thanks,
Jamie
Hello Jamie,
Here is how to get the DataRecordCellArea in code :
DataRecordCellArea drc = Infragistics.Windows.Utilities.GetDescendantFromType(presenter,
typeof(DataRecordCellArea), false) as DataRecordCellArea;
drc.Background = new SolidColorBrush(Colors.Red);
Hope this helps
Thanks Alex, that's what I was looking for.