I am using the summary row on my WebDataGrid to show totals for financial columns. This is working very nicely, with the summary info added programmatically to the appropriate columns, and ShowSummariesButton="false" in the html source. However, I now want to add a label in the summary row in the first column to show "Totals:" or some variant of that.
I've gone through the exercise of programmatically adding a custom summary to the first column so that it will show the text I want it to. That is working fine. However, the summary button icon is showing up in the header of that column with the custom summary, even though ShowSummariesButton="false" at the grid level.
Any idea why that summary button would be showing up in the header, overriding my choice in the ShowSummariesButton attribute? I've looked through the ColumnSummaryInfo, Summary, SummaryRowSetting and SummarySetting objects and in none of them do I see the ability to affect the summary button.
Is there another way to update the text in a summary cell? This seems like something that you'd expect there to be an event handler for. Adding a custom summary just for this seems like serious overkill.
Thanks for your help,
Phil
Hello,I have created a sample which describes your situation and tested it with IE 9 and Firefox 6 and found out no button showing. Please modify the sample if it is not reproducing your code or make a new one and specify in which browser this misbehavior occurs. For more information about Row summaries you can reffer the following link from our documentation - http://help.infragistics.com/Help/NetAdvantage/ASPNET/2010.3/CLR4.0/html/WebDataGrid_Enabling_Summary_Row.html
Hello Phillip,Please let me know if you need more assistance with this issue.
I'm sorry Nikifor, I hadn't gotten a chance to look at the sample. I will look at it right now as I finally have a little lull in my schedule. I'll let you know today if I'm able to resolve the issue following your example. If not, I'll attach more code.
FYI, I'm testing in Firefox 5 and now 6.
Nikifor,
Thank you. Using that sample as guidance I was able to resolve the issue with the summary button showing up when it seemed it shouldn't.
Thanks so much for your help.
Phil Peters
Hello PhilPlease take a look at the sample i am sending you. If you comment the adding of summary in code behind (rows 99-107) the unnecessary button will disappear. If you have some difficulties with setting your own grid like the one from the sample do not hesitate to ask.
That's great. Thanks for the update. I look forward to hearing from you.
Hello Phil,I managed to reproduce the behavior you described. In the moment I am investigating if its a bug or an expecting behavior. I will contact you as soon as I have made progress with this case.
My situation seems a little different than the sample you put together. Here is my rendered grid:
The circled words in the summary row are determine programmatically and need to be inserted into that columns summary cell. So I am not able to do anything in markup. Here is my Behaviors tag:
<Behaviors> <ig:SummaryRow ShowSummariesButtons="false" FormatString="{1}" EmptyFooterText="" CompactRendering="On" SummariesCssClass="headerGrid"> <ColumnSummaries> </ColumnSummaries> </ig:SummaryRow> <ig:ColumnFixing AutoAdjustCells="true" ShowRightSeparator="true" ShowLeftSeparator="true" ShowFixButtons="false"> <ColumnSettings> </ColumnSettings> </ig:ColumnFixing> </Behaviors>
You'll note that I have some extra attributes specified, such as the FormatString and CompactRendering="On".
Then via code I build the columns just before binding the grid. For that first column I do the following extra work, besides adding the column to the columns collection:
SummaryRowSetting oTopCategoryNameRowSetting = new SummaryRowSetting(wdgPlanningAggregate, FieldKey); SummarySetting oTopCategoryNameSetting = new SummarySetting(); oTopCategoryNameSetting.SummaryType = SummaryType.Custom; oTopCategoryNameSetting.CustomSummaryName = "TopCategoryName"; oTopCategoryNameSetting.FormatString = ExpenseCategory; oTopCategoryNameSetting.CssClass = "headerGrid"; oTopCategoryNameSetting.ShowOptionInDropDown = false; oTopCategoryNameRowSetting.SummarySettings.Add(oTopCategoryNameSetting); wdgPlanningAggregate.Behaviors.SummaryRow.ColumnSettings.Add(oTopCategoryNameRowSetting);oSummaryInfo = new ColumnSummaryInfo(); oSummaryInfo.ColumnKey = field.Key; Summary oSummary = new Summary(); oSummary.SummaryType = SummaryType.Custom; oSummary.CustomSummaryName = "TopCategoryName"; oSummaryInfo.Summaries.Add(oSummary);grid.Behaviors.SummaryRow.ColumnSummaries.Add(oSummaryInfo);
This code defines the custom summary and puts it in the ColumnSettings collection, and then adds the custom summary for that first field into the ColumnSummaries collection, so that it is "on" for that column.
In your example you were using SummaryType of Sum, whereas I need to use Custom. I've tried changing that to Count, which is the only other valid type for a string column. It still caused the summary button to show as you see in the image above.
Could you update your sample to work in this similar fashion and see if it causes the summary button to show up?
Thanks,