Hi this below code display summary in my webdatagrid. I am looking for ways how can i change the Summary Name Like Sum to Total FG Summary something like that.
Thanks in Regards
SummaryRow fs = WebDataGridPicklistBatch.Behaviors.CreateBehavior<SummaryRow>();
//add default summaries
if (!this.IsPostBack && fs != null)
{
ColumnSummaryInfo info1 = new ColumnSummaryInfo();
info1.ColumnKey = "FGQuantity";
info1.Summaries.Add(SummaryType.Sum);
fs.ColumnSummaries.Add(info1);
ColumnSummaryInfo info2 = new ColumnSummaryInfo();
info2.ColumnKey = "POQuantity";
info2.Summaries.Add(SummaryType.Sum);
fs.ColumnSummaries.Add(info2);
}
Wow that's what im looking for...Thanks
I just edited your code on the second Summary to summary to display the two summary row name for the two columns.
Summary summary = new Summary();
summary.CustomSummaryName = "Total FG ";
summary.SummaryType = SummaryType.Sum;
info1.Summaries.Add(summary);
Summary summary2 = new Summary();
summary2.CustomSummaryName = "Total PO QTY ";
summary2.SummaryType = SummaryType.Sum;
info2.Summaries.Add(summary2);
Hi NewbApps,
you will have to set Custom Summary Name, in your case it should be something like:
SummaryRow fs = WebDataGridPicklistBatch.Behaviors.CreateBehavior<SummaryRow>(); //add default summaries if (!this.IsPostBack && fs != null) { ColumnSummaryInfo info1 = new ColumnSummaryInfo(); info1.ColumnKey = "FGQuantity"; Summary summary = new Summary(); summary.CustomSummaryName = "Total FG "; summary.SummaryType = SummaryType.Sum; info1.Summaries.Add(summary); fs.ColumnSummaries.Add(info1); ColumnSummaryInfo info2 = new ColumnSummaryInfo(); info2.ColumnKey = "POQuantity"; Summary summary = new Summary(); summary.CustomSummaryName = "Total FG "; summary.SummaryType = SummaryType.Sum; info2.Summaries.Add(summary); fs.ColumnSummaries.Add(info2); }
Summary summary = new Summary(); summary.CustomSummaryName = "Total FG "; summary.SummaryType = SummaryType.Sum;
info2.Summaries.Add(summary);
However this will change the summary name only in the summary row. To change it in both places Summary Row and the Summary Selection window you may use something like:
//Create SummarySetting SummarySetting ss = new SummarySetting(); ss.CustomSummaryName = "Total FG"; ss.SummaryType = SummaryType.Sum; //Create SummaryRowSetting SummaryRowSetting srs = new SummaryRowSetting(WebDataGridPicklistBatch, "FGQuantity"); //Add SummarySetting to the SummaryRowSetting srs.SummarySettings.Add(ss); SummaryRow fs = WebDataGridPicklistBatch.Behaviors.CreateBehavior<SummaryRow>(); fs.ColumnSettings.Add(srs); ColumnSummaryInfo info3 = new ColumnSummaryInfo(); info3.ColumnKey = "FGQuantity"; Summary summary = new Summary(); summary.CustomSummaryName = "Total FG"; summary.SummaryType = SummaryType.Sum; info3.Summaries.Add(summary); fs.ColumnSummaries.Add(info3);
Please let me know if these suggestions are helpful