Hi All,
I am making use of UltraWinGrid in my application. I have added a column under the sortedcolumnscollection by default. So, by default my grid would be grouped by a column say "Project Number". I have added summary for many columns in my grid. I have given the summary display area as "InGroupByRows" and hence I would get the summaries in my group-by rows. Now, I would like to get the summary of all the group-by rows in the bottom. You can understand what am looking for below
I want the consolidated summary at the bottom apart from the summary in each and every group-by row. How could I achieve that? Any help would be of great use.
Regards,
Raghuraman.V
SummaryDisplayAreas is a flagged enumeration, so you can specify multiple values by ORing them together.
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { e.Layout.Override.SummaryDisplayArea = SummaryDisplayAreas.InGroupByRows | SummaryDisplayAreas.RootRowsFootersOnly | SummaryDisplayAreas.Bottom; }
Is this possible to have the alignment of multiple summaries in a way that, one summary is docked in Leftside of the grid and another summary is docked in bottom of the grid.I am using infragistics v9.2. It would be great if some one is helping me to achieve this. Thanks in advance.The UI is something like below.
Hi Raja,
From your questions, it sounds like you want the entire unbound column to be one big button that covers the cells and the header. Is that right? Or do you want a button on each row? If I can understand exactly what you want to do, I can try to whip up a sample for you.
Thanks a lot Mike.Yes, my need is one big button that covers the cells and the header.Please share the sample code to achieve this behaviour.
Hi,
I tried this out using a CreationFilter, and I found it very difficult. I think it will be extremely difficult to get this to work reliably where the button covers both the cells and the column header. But if you are willing to have the button just cover the cells and not the header, I was able to get it working by using cell merging.
By merging the unbound column, it simplifies things quite a bit, because the entire column of cells becomes one big cell, anyway.
I have attached a sample here demonstrating how I did it.
Mike,
Thanks a lot for the sample code. This sample gives my desired UI.
From functionality wise I need one more help.
I need to subscribe the click event of the bigger button we have placed in unbound column.I have subscribed for ElementClick event. But it doesnt work.
Meanwhile I have tried a custom class for ButtonUI and created a overridden method for ButtonClick and OnMouseEnter. I am getting hit in OnMouseEnter. but not getting hit in ButtonClick method.
Please help me to get the click event of ButtonUI which is placed in ultracombo column.
Thanks in advance.
Wow... this was a tough one to track down. It looks like the ButtonClick isn't firing because the button is contained within the MergedCellUIElement and this element is intentionally passing mouse message on to the cells underneath it.
It took me a while, but I found a way around it. Instead of putting the ButtonUIElement inside the MergedCellUIElement, I replaced the element, instead.So change around BeforeCreateChildElements like so:
bool IUIElementCreationFilter.BeforeCreateChildElements(UIElement parent) { // Watch for the merged cell of the unbound button column. MergedCellUIElement mergedCellUIElement = parent as MergedCellUIElement; if (null != mergedCellUIElement && mergedCellUIElement.Column.Key == "ButtonColumn") { UIElement grandParent = parent.Parent; // Get the ButtonUIElement, if there is one, or if not, create a new one. MyButtonUIElement buttonUIElement = grandParent.GetDescendant(typeof(MyButtonUIElement)) as MyButtonUIElement; if (null == buttonUIElement) { buttonUIElement = new MyButtonUIElement(parent); grandParent.ChildElements.Add(buttonUIElement); } // Set the rect of the button element to the merhed cell rect. buttonUIElement.Rect = parent.Rect; grandParent.ChildElements.Remove(mergedCellUIElement); return true; } // Do nothing return false; }