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
Summary Section Too Small?
posted

Is there a way to expand the summary area? I've tried a number of things but it still seems to only allocate a small box in which to enter "Sum = 123456" so the text is always cutoff. I've created a custom summary before and it suffers from the same problem - so my hope is that I'm just doing it wrong. :-)

Infragistics v8.2

 

 

// Add a summary that totals the amount column
if (!band.Summaries.Exists(SUMMARY_KEY)){
     SummarySettings totalSummary = band.Summaries.Add( SummaryType.Sum,
                                                              amountColumn,
SummaryPosition

.Right);
     totalSummary.Key = SUMMARY_KEY;
}

Parents
  • 220
    posted

    I tried that and it works for this instance, thanks. Is there any way to allow it to have the entire row available to the summary?

  • 469350
    Verified Answer
    Offline posted in reply to Chris

    There's no property for that, although now that you mention it, it sounds like a great idea. You should Submit a feature request to Infragistics.

    The only way to do it right now would be to use a CreationFilter. This would be a fairly simple CreationFilter, assuming you only have one summary. You would have have to expand the SummaryValueUIElement so that it fills it's parent element.

    Something like this:


        public class FullLineSummaryCreationFilter : IUIElementCreationFilter
        {
            #region IUIElementCreationFilter Members

            public void AfterCreateChildElements(UIElement parent)
            {
                FreeFormSummaryLineUIElement freeFormSummaryLineUIElement = parent as FreeFormSummaryLineUIElement;
                if (freeFormSummaryLineUIElement != null)
                {
                    Debug.Assert(freeFormSummaryLineUIElement.ChildElements.Count == 1, "We are asumming that there is only one summary. This code won't work right if there is more than 1.");
                    SummaryValueUIElement summaryValueUIElement = freeFormSummaryLineUIElement.ChildElements[0] as SummaryValueUIElement;
                    if (summaryValueUIElement != null)
                    {
                        summaryValueUIElement.Rect = parent.RectInsideBorders;
                    }
                    else
                        Debug.Fail("The child element of the FreeFormSummaryLineUIElement is not a SummaryValueUIElement; unexpected.");
                }
            }

            public bool BeforeCreateChildElements(UIElement parent)
            {
                return false;
            }

            #endregion
        }

     

Reply Children