Hello,
I have the following XAML and the BackgroundActive property in my ViewModel gets read, but doesn't seem to get set in the datagrid. If I hardcode a brush color to the BackgroundActive value, it displays as it should. Any help much appreciated.
<igDP:XamDataGrid Name="DocumentsGrid" DataSource="{Binding Documents}" ActiveDataItem="{Binding SelectedRow}" RecordLoadMode="{Binding GridRecordLoadMode, Mode=OneTime}" RecordContainerGenerationMode="{Binding ContainerGenerationMode, Mode=OneTime}">
<igDP:XamDataGrid.Resources>
<Style TargetType="{x:Type igDP:DataRecordCellArea}">
<Setter Property="BackgroundActive" Value="{Binding DataContext.ActiveGridRowColor, ElementName=DocumentsGrid, Mode=OneWay}"/>
</Style>
</igDP:XamDataGrid.Resources>
<igDP:XamDataGrid.FieldSettings>
<igDP:FieldSettings AllowEdit="False" />
</igDP:XamDataGrid.FieldSettings>
</igDP:XamDataGrid>
So bottom line is you cannot reproduce the problem with a sample project? It only happens in your real code? If you can reproduce the problem with the sample, please attach it. If not, if your project is not too large, perhaps you could simply email me the project or make arrangements with me to FTP it to me.
Curtisctaylor@infragistics.com
Well it seems I've gotten the ActiveGridRowColor property to read, however it's not setting the brush color from that property in my ViewModel. Right now I have it returning Brushes.Blue, but it seems that if it reads from my property it becomes transparent...Basically I'm back to square one :)
I think I see what's going on... in the new sample project I created, I prepopulate the Documents datatable in the ViewModel constructor. ActiveGridRowColor properly reads from my property.
In my project where it doesn't work, I don't prepopulate the Documents datatable as it's populated by an event handler. ActiveGridRowColor doesn't get read and set this way... Is there any way to get the desired result without prepopulating the Datagrid's data source?
Just to confirm, I started a new project except that I put the datagrid in a window instead of a usercontrol, created a new ViewModel with the same properties as my project and lo and behold, it works as intended...
However, my original project doesn't seem to work....weird! I'll keep looking at it. Thanks again for your help!
How odd, it works for me. OK. So I can send you a working sample and you can compare what I did with your code or you can create a sample project that resembles your code and I will make it work in your sample. Whatever is easiest for you!