Hello,
I use a TextColumn with a IValueConverter in a xamgrid to get a specific format on the grid value.
Is it possible to use the same converter on some summary operands (Minimum, Maximum, ...) to get the same format in summary? Summary has a FormatString property but no ValueConverter property.
Regards,Julien
There is no way through the API to switch out the value converter. The SummaryRowCellControl has a uses the FormatString in it's value converter which is assigned in the Generic.xaml.
Which means you could retemplate the SummaryRowCellControl to use your converter though.
Is it possible to get a sample explaining how to retemplate a summary ? Is it possible to this on a column per column basis?
Actually the summaries are the only place where I can not use converter : this is possible for group by via a Template.
It's a pity that when you use a format string or a converter on a TextColumn, you don't get the same converter or format string automatically when the column is grouped or used for summary. That would be a great feature and simplify the work of developpers in some situation (enum, date, numbers with correct formatting in a TextColumn)
Hello Petar,
I'm sorry I didn't reply earlier : I didn't get the email notification for your post.
Thanks for your sample : this is really interesting, and I think we're close, but this is not enough : I need to customize the converter only for some columns, and they may have different converters.
Do you think it's possible to customize the converter (or the datatemplate) for the summary of only one column? It's possible to customize the datatemplate for group by row headers.
Ideally I would like to set the converter to the same than the text column if it has a converter for each column (but I suppose the count sumary will not need a converter as it's always an Int). This seems complex.
If it's not possible, I think we can wait for this feature in a later version.
Regards,Julien Benoit
Hello Julien,
In order to make the converter work differently for the different columns simply check the ColumnKey before applying the necessary formatting. Here is code snippet that will format summary values only for the “FirstName” column:
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if ((value as SummaryResult).SummaryDefinition.ColumnKey == "FirstName")
return String.Format("CUSTOM SUMMARY: {0}", (value as SummaryResult).Value);
}
else return (value as SummaryResult).Value.ToString();
I suppose the same approach could be used for the group by record headers. You can try it out with the GroupByHeaderCellControl template from the XamGrid.xml file in the default styles folder (default install path: C:\Program Files (x86)\Infragistics\NetAdvantage 2010.2\Silverlight\Default Styles)
Please let me know if I can assist you with anything else.
Sincerely,
Petar Monov
Developer Support Engineer
Infragistics Bulgaria
www.infragistics.com/support
I am just checking if you had a chance to try this out and if you require any assistance or clarification on the matter.
If this is what you were looking for please verify the answer so it helps other users as well.
Regards Petar.
I didn't get the email notification, so I didn't see your earlier answer : it looks very promising.
I will post back here when I have tested it.
Thanks for your help!
Hi Julien ,
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
Sincerely,Petar MonovDeveloper Support EngineerInfragistics Bulgariawww.infragistics.com/support