public GridViewSummary RegisterSummary(string column, string formatString, SummaryOperation operation, string groupName) { if (operation == SummaryOperation.Custom) { throw new Exception(USE_ADEQUATE_METHOD_TO_REGISTER_THE_SUMMARY); } GridViewGroup group = mGroups[groupName]; if (group == null) { throw new Exception(String.Format(GROUP_NOT_FOUND, groupName)); } // TO DO: Perform column validation... GridViewSummary s = new GridViewSummary(column, formatString, operation, group); group.AddSummary(s); return(s); }
public GridViewSummary RegisterSummary(GridViewSummary s) { if (!s.Validate()) { throw new Exception(INVALID_SUMMARY); } if (s.Group == null) { // if general summaries are displayed in the footer, it must be set to visible if (useFooter) { mGrid.ShowFooter = true; } mGeneralSummaries.Add(s); } else if (!s.Group.ContainsSummary(s)) { s.Group.AddSummary(s); } return(s); }
public bool ContainsSummary(GridViewSummary s) { return(mSummaries.Contains(s)); }