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.
Thank you for your response. I believe that other community members may benefit from this.
I don't want default header in the xam data card. Can we do it?
Also one field is Boolean type (check box), i am showing it as "string" value (yes and no) using BooleanToString converter, now the problem is the theme style is not applied on this field.
Hello Rachita,
You could hide the default header of the XamDataCard by setting the HeaderVisibility property of the CardViewSettings to collapsed:
<igDP:XamDataCards.ViewSettings>
<igDP:CardViewSettings HeaderPath="Model.theName"
HeaderVisibility="Visible" />
</igDP:XamDataCards.ViewSettings>
I am not sure I have understood the other part of your scenario correctly. Could you provide me any sample project or code snippet to demonstrate this behavior so that I could provide you a better solution?
Thank you.
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.
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 :)
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.
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.
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.