Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
220
How to add text to a column in Summary row when all the other columns show sum in summary
posted

Hi,

We have upgraded from Infragistics 2011.1 to Infragistics 2014.1 and are trying to get familiar with the new controls.

I am showing Summary(Sum) of columns in WebDataGrid. The grid has AutoGenerateColumns="true" and I am adding the summary row in code behind. I was able to add the summary for all numeric columns but I need to add a text ("Grand Total:") to the summary for the first column which is a string type. In the old version, we simply used to set it as the footer text.

Please advise how to do this.

ASPX:

<igtbl:WebDataGrid ID="wdgRAWNAVReported" AutoGenerateColumns="true" runat="server" OnDataBound="wgRAWNAVReported_DataBound"
Height="560px" Width="100%" EnableTheming="True" EnableDataViewState="true" OnPreRender="WebDataGrid_OnPreRender">
<Behaviors>
<igtbl:SummaryRow Enabled="true" ShowSummariesButtons="false" EmptyFooterText="">
</igtbl:SummaryRow>
</Behaviors>
</igtbl:WebDataGrid>

C#:

foreach (GridField gridField in fields)
{
var ufield = gridField as AutoGeneratedDataField;

if (ufield != null)
{
if (!ufield.Key.ToLower().Contains("portfolio"))
{
var csi = new ColumnSummaryInfo();
csi.ColumnKey = ufield.Key;
csi.Summaries.Add(SummaryType.Sum);

var srs = new SummaryRowSetting();
srs.ColumnKey = ufield.Key;
srs.FormatString = "{1}";
srs.ShowSummaryButton = false;

wdgRAWNAVReported.Behaviors.SummaryRow.ColumnSummaries.Add(csi);
wdgRAWNAVReported.Behaviors.SummaryRow.ColumnSettings.Add(srs);
}
}
}

Thanks!

Parents Reply Children
No Data