Hi,
We use XamGrid to display records with conditional formatting with auto generated columns its working with following steps.
Hi elinder,
I wasn't sure which kind of ConditionalFormattingRuleBase you are using so I used a simple one just to illustrate how you would do this.
Basically, since you are declaring all of these columns in XAML, you can just create the rules in XAML as well. http://help.infragistics.com/doc/WPF/2014.2/CLR4.0/?page=xamGrid_Conditional_Formatting.html
This, however, may add quite a bit of extra XAML so you might be inclined to do it programmatically in code-behind. For that you should handle the ColumnLayoutAssigned event and then iterate over the GroupColumns, then iterate over the GroupColumn.Columns collection and assign your conditional rules accordingly. I have attached a sample that demonstrates this.
As for the FormatString percent symbol, how you handle this depends on what you want to occur. Underneath the hood, the XamGrid cell is just using normal Microsoft string formatting so what you are seeing is pretty much expected. In order to deal with this, I created a style for TextBlock and added a DataTrigger to the cell value. When the cell value is null, it sets the TextBlock's Visibility to Collapsed. This style is then assigned to the TextColumn.TextBlockStyle property. You can see this in the sample as well.
Let me know if you have any questions.
Hi Rob,
Thank you so much, your provided solution solved my problem.