How do I set the background on a XamDataCard?
Hello Darlo,
In order to change the background of the XamDataCards you can use the Background property and set it to some color: Background="Azure". If you want to change the color of the DataRecordCellArea in the CardViewCard items of the XamDataCards you can set a style:
<Style TargetType="{x:Type igDP:DataRecordCellArea}">
<Setter Property="Background" Value="Yellow"/>
</Style>
Please let me know if you have any questions on the matter.
Hello Maria,
with your style sample I was able to make the background of all fields yellow. What about when I just want to set the backgroundcolor of a single field of a datacard, how can I do that? And I want to make all the other fields not editable. So my field "Real Weight" should have a yellow background and should be editable, the other fields should not. Right now my datacard Looks like this:
<igDP:XamDataCards Grid.Row="2" HorizontalAlignment="Left" Margin="12,12,0,0" Name="xamDataCards1" VerticalAlignment="Top" DataSource="{Binding ElementName=xamMultiColumnComboEditor1, Path=SelectedItems}"> <igDP:XamDataCards.FieldLayouts> <igDP:FieldLayout > <igDP:FieldLayout.Fields> <igDP:Field Name="Name" Label="Name" /> <igDP:Field Name="Volume" Label="Volume" /> <igDP:Field Name="TargetWeight" Label="Target Weight" /> <igDP:Field Name="ImageUrl" Label="Image" /> <igDP:UnboundField Name ="RealWeight" Label="Real Weight"> </igDP:UnboundField> </igDP:FieldLayout.Fields> </igDP:FieldLayout> </igDP:XamDataCards.FieldLayouts> </igDP:XamDataCards>
This does not work. It wasn't the DataRecordCellArea background I needed to change, I wanted to change the background of the entire control. I was able to achieve it by doing this.
<SolidColorBrush x:Key="{ComponentResourceKey {x:Type igDP:XamDataGrid}, CardBackground}" PresentationOptions:Freeze="true" Color="Blue"/>
Thanks for your help.