We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to get converted value in GridCaptionSummaryCell?

Hi All,

my column by which I'd like to group my table, shows values applying a converter. The values in the column are OK i.e. converted. But if I group the table by this column, the caption summary cell shows base values instead of converted ones as key (next to amount). Should the conversion happen automatically as it does within the column or do I have to specify somewhere that this is to be done? If the latter is true, where and how do I have to specify it?

Best regards,
Benedikt

1 Reply

SR Sivakumar R Syncfusion Team December 18, 2015 04:03 AM UTC

Hi Benedikt,

You can customize the caption summary row key based on display value by writing CustomCaptionSummaryRenderer.

//default CaptionSummaryCellRenderer is removed.           

this.AssociatedObject.CellRenderers.Remove("CaptionSummary");


//Customized CaptionSummaryCellRenderer is added.
this.AssociatedObject.CellRenderers.Add("CaptionSummary", new CustomCaptionSummaryCellRenderer());


In the CustomCaptionSummaryCellRenderer caption text is calculated based on Display value instead of actual value.

private string GetCustomizedCaptionText(GridColumn column, object record, int count)

{

    if (propertyprovider == null)

        propertyprovider = this.DataGrid.View.GetPropertyAccessProvider();

    var key = propertyprovider.GetFormattedValue(record, column.MappingName);

    return column.HeaderText + " : " + (key == null ? string.Empty : key.ToString()) + " - " + count.ToString() +

            " Items ";
}


Find the sample from below location,
http://www.syncfusion.com/downloads/support/forum/121458/ze/WPF_-_Copy934553414

Thanks,
Sivakumar


Loader.
Up arrow icon