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,
I'm not 100% clear on what you want to do here. Do you mean you want a summary to the left of the grid rows? That is, to the left of the data or the column headers and not under the rows? There isn't any built-in way to do that.
If you really wanted to work at it, you could probably achieve something like this using a CreationFilter. But there are a lot of unknowns here for me, so it's hard to offer any more specific advice. Are you showing the RowSelectors? If so, I assume you would want the summary to the left of those, as well? That would be extremely difficult. If there are no row selectors, or you don't mind the summary being to the right of them, then you could add an unbound column to the first position in your grid just as a sort've placeholder and then use a CreationFilter to place a summary element in that column. But it would not be trivial.
Thanks for the reply. Yes,I need to have the summary to the left side of the grid. why I need this is , I will place a ButtonUIElement there.
I need to achieve the UI like a table Layout panel with 1 row and 2 columns.In which the first column will hold my ButtonUIElement and the second column will hold the Grid displaylayout. I am not using any row selectors. Also I am not using the summary to any rows.
From your response I hope we can achieve this by using Creation filter. Can you please attach the sample code to achieve this by using creation filter.
Thanks in advance.
Hi Raja,
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; }
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.
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.
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.
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.