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.
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.
Hi Maria,
Thanks for the reply , this is working fine now. My Problem is I am grouping few fileds in the data card, in which few fields are boolean type (check box), using converter i am showing its value in "Yes" and "No". Now the theme default style is not working to these area. Below is the screen shot.
Hello Rachita,
Thank you for the details. It seems that the screenshot did not upload. Would you try to upload it again?
I could suggest you to look at this blog post where the most common style issues when using a theme are described. Please look at the Scenario 1 and Scenario 2 off the section Problem 1 and let me know if any of the suggested approaches helps you.
By Default decimal values are right align in xamdatacard and text values are left align. I need to show all control either left or right.
I want to change the alignment of decimal values to left. Please help i am not able to do.
Actually i am using theme in xamdatacard, thats why other styles are not working, if i do not use any theme , i am able to show decimal values left align.
When you use a theme, the style for the theme is applied over all other styles and this is the reason why the alignment of the text is not changed if you use a style. In order to apply your custom style you could use its BasedOn property in order to show the values left aligned. Here is a code snippet where I use LunaOlive theme:
<Style TargetType="{x:Type editors:XamNumericEditor}" BasedOn="{x:Static igThemes:EditorsLunaNormal.XamNumericEditor}">
<Setter Property="HorizontalContentAlignment" Value="Left"/>
I attached a sample project demonstrating this. If you have any other questions, please do not hesitate to ask.
Thank you for your feedback. I am glad that you resolved your issue.
If you have any other questions, please do not hesitate to ask.
It worked thanks :)