Is there any way to change cell or column background or foreground colours?
Hi WPFDEV,
You can do this in xaml as well by defining a style and on event trigger change the background red
<Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="SelectedCellStyle">
>
="True" >
="Red"/>
Sorry,
I haven't looked at it, it appears it got lost among the other forum threads.
The code that you are using is executed too early. The CVP is not generated yet. You can use this code as early as the Loaded event of the XamDataGrid when CellValuePresenters are generated.
31 void XamDataGrid1_Loaded(object sender, RoutedEventArgs e)
32 {
33 DataRecord dataRecord = (DataRecord)this.XamDataGrid1.Records[1];
34
35 Infragistics.Windows.DataPresenter.Field field = dataRecord.FieldLayout.Fields[1];
36 CellValuePresenter cellValuePresenter = CellValuePresenter.FromRecordAndField(dataRecord, field);
37
38 if (cellValuePresenter != null)
39 cellValuePresenter.Value = "Some car";
40 }
Hi Alex, did you have a chance to have a look at the sample I sent to you last week?
Attached is a sample application made by using your object data binding sample.
Can you provide a sample application so that we can look into it?