Hello,
I have a xamDataGrid whose DataContext is set to my view model. There is a property on my view model, call it GridData, that the grid's DataSource is bound to.
GridData is a collection of MyObjects and each MyObject has a Color property. I want to use the value of the MyObject's Color property as the color of the row.
I tried addind the following:
<igDP:XamDataGrid.Resources> <Style TargetType="{x:Type igDP:DataRecordPresenter}"> <Setter Property="Background"> <Setter.Value> <SolidColorBrush Color="{Binding Path=DataItem.Color}"/> </Setter.Value> </Setter> </Style> </igDP:XamDataGrid.Resources>
but I get the below error:
"Cannot find governing FrameworkElement or FrameworkContentElement for target element"
How can I bind the row Background to the DataItem's Color property? Can I get a sample app demonstrating this please?
Thanks.
Hi,
I tried your code and it was working fine. I am attaching a sample application.
Let me know if this doesn’t work for you.
Thanks,
Diyan Dimitrov
I am having the same problem. I downloaded the sample code and the sample code exhibits the same problem that the first user (and I) are seeing. It is here: