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; }
RowLayouts don't make any difference, you can still have summaries in RowLayout mode. But CardView might be a different story. Are you using CardView?
Are you using a RowLayout in this? If so I always thought with RowLayout you couldn't have summaries although I have never really tried for that matter.
Well, the only explaination that I can think of is that either the summaries are getting removed after this code fires - or that this code is never getting hit in the first place. Maybe your event handler has come unhooked?
That's correct. I do not see any summaries.
The grid was done with the designer, but the code I posted is the only run time code I am interjecting. I usually like to do everything at runtime personally, but this part of our app was already mocked up with the designer so I just went with it.
Hi,
I don't see anything obviously wrong with this code. You are saying you do not see any summaries at all?
My best guess would be that something in your code that is occurring after this must be removing the summary. Are you loading a layout into the grid?