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
705
record count summary using row layout
posted

I have a C# app that is using the ultragrid in the same manner as the "row layout" example that you have in your samples.

We used the designer to generate the overall look and feel of the layout.  So far it's working great, but I need to be able to add a record count summary that shows how many records they have on the grid (this needs to show at load and also if they add/delete any records on the grid at runtime).

I've done summaries in the past but not using the row layout method.  I put the code below in place and can verify that it runs.  But I don't see any results.  Any ideas what I may be doing wrong?

private void UltraGridSellers_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            e.Layout.Override.AllowRowSummaries = AllowRowSummaries.False;
            e.Layout.Override.SummaryFooterCaptionVisible = DefaultableBoolean.False;
            e.Layout.Override.SummaryDisplayArea = SummaryDisplayAreas.Top;

            UltraGridColumn columnCount = e.Layout.Bands[0].Columns["NAME"];
            SummarySettings summary = e.Layout.Bands[0].Summaries.Add("", SummaryType.Count, columnCount);
            summary.DisplayFormat = "Record Count: {0}";
            summary.Appearance.TextHAlign = HAlign.Right;
        }