I know I can apply FormatString to format Column Display in XAML. But I want to format Columns dynamically (depending on some conditions). How can I implement it in Code Behind? Thanks.
Hi,
((TextColumn)grid.Columns["YourTextColKey"]).FormatString = ....
-SteveZ
Hi, Steve,
There are two buttons that control the Display Mode.
You are right. I want to format the entire column. "...So if you're trying to do it on the entire column level, then you can just change that property. ..." How can I change the property in code behind? Thanks.
So what causes the condition to change?
The FormatString property on a TextColumn is for the entire column not a particular cell. So if you're trying to do it on the entire column level, then you can just change that property.
The data provided by SQL Server via RIA are decimal. I want the SAME column of grid to display only the integer part OR with three decimal places at different time, depending on the condition. If the FormatString can be implemented at code behind, we can set the FormatString conditionally.
Thanks.
Assuming your data implements INotifyCollectionChanged, then if you raise the PropertyChanged event when your data should update, the ValueConverter will automatically invalidate and be raised again, so you can then apply your "new" change to how the data is displayed.
Could you describe your scenario with a bit more detail, so i can give you a better suggestion on what to do.