I was trying to set the value of the unbound field in xamdatagrid. The value of field3 = field1 + field2.
Also I wanted to attach style to it which would change the foreground of the unbound field (field3) to red for negative values and black for +ve values
Is it possible to do this in xaml or I have to write code in xaml and cs both?
Thanks,
Harshad
Hello Alex, I am also looking for the same but my 3rd field (unbound) should be calculated in the XAML.
But the XamFeatureBrowser shows a way using code behind. Is there anyway we can accomplish this
using CellValuePresenter? Please let me know your thoughts!
Can you please modify the sample in the forum thread that you mentioned and attach it to your next forum thread so that we can look into it?
Hi Alex,
I had tried the approach you mentioned. The value came out fine on the column. But I couldnt get the color (style) working. The converter I had only worked for bound fields. The value for the unbound field in the convert method was coming up to null or text. I was putting cellpresenterstyle template inside field settings for unbound field. But somehow putting style for color wasnt working.
I was trying to set the field value using this post (the value was set correctly):
http://forums.infragistics.com/forums/t/33235.aspx
Harshad,
You would need a IValueConverter to handle the change of foreground color. For more information on how to do that, you can see in this forum thread: http://community.infragistics.com/forums/p/20644/80133.aspx#80133
Regarding the UnboundField, there is a sample for this in the XamFeatureBrowser - Using UnboundFields.
Hope this helps.