Hi,
I am evaluating IG UltraGrid to possibly replace a custom grid implementation. I used IG years ago, liked it, recommended it at my new workplace... now I need to get this thing to do some unusual things or it wont be accepted.
I have the following data structure: Alfa contains a list of Bravo, contains a a list of Charlie. Simple enough.
Here's a sample of the current grid (Pool Zone Nord B= Alfa, CI = Bravo, Blurred values = Charlie). The red areas usually contain numeric values as well.
Now what's the deal? The column headers at the very top need to be specific. In this case the 1st col header is void but essentially it could be "Name", all other columns are dates. Then it gets tricky: They expand values within this column structure. This differs from the usual way hierarchies are displayed (non discussable). I hope the screencap helps as I find it difficult to explain.
I've tried flattening my data, which - when using grouping - partially fixed the problem. But I still can't get my column headers as a I need em: They are always displayed within the grouping and not on top where I need to be (kind of statically).
Forget about the totals for the time being, I'll be happy if I can get this "aggregation" (if that's the appropriate word) type of display.
Can anyone help? This is rather urgent and acceptance of the suite depends on it (quite a few potential licences actually).
Thank you,
Teun Segers
-EDIT-
Ok I figured how to het the labels where I need: HeaderPlacement.FixedOnTop solves my issue. However it also showed that my use of groups probably means I cannot display totals like in the old grid... not quite there yet.
-EDIT 2-
This mostly solves it: http://community.infragistics.com/forums/p/32384/176621.aspx
Although now they've told me they need to be custom calculated values, let's see if we can stick those in there...
Mike you were right. I got caught in screwy thought pattern. For the final requirements (different from the inital ones) it works very easily with datasource manipulation. Thanks for setting me straight!
Just one last simple question: I need to hide 1 ColHeader. Right now I am using the Alpha property to do this (which works fine), but that seems wrong. However the Hidden property applies to the whole column (not just the Header). Am I doing it right?
Now the headers shown in my sample are of the lowest level. This means if the first column's header is shown (future requirement) it isn't wide enough (which makes perfect sense, but is not what I need). Colspan doesn't help me. Can I show a Header in that location (where the red text is in the image) that will fill the whole space?
- EDIT -
The grid will later be used purely programmaticaly (layout will be inferred from a datasource with layout meta in it which will be interpreted to config the grid). For this reason I prefer not to use RowLayouts as that seems very designer specific.
HiddenWgenGroupBy: Didn't know that! I tried putting Hidden=False -> didn't work. Thanks for that one!
I now understand your datasource based approach (let's call it plan C). You are correct that this may be simpler. I am going to evaluate both B and C.
Right now I got B working conceptually (been a useful experience in embedding controls whether I end up using it or not). That ControlContainerEditor isn't the most obvious thing ever to implement I must say... but once you figure it out it's not bad.
It's always so hard to get these concepts across in a forum, even with screencaps. Anyway, thanks again for your input - possibly back to the drawing for iteration 4.
Teun said:Another problem I encountered was that I couldn't show the value being used to do the group by anymore (it was shown in the GroupByRow, but I didn't want it there).
The grouped column is hidden by default, but it doesn't have to be. You just set HiddenWhenGroupBy on the column to false.
Teun said: Let me explain plan B a bit better (I'm implementing this now). I create a usercontrol "CollapseLabel" that displays a button that looks either like a "+" or a "-" followed by some text. Left of the button is an optional margin to create indentation. This control populates my first column. That CollapseLabel will then filter the grid to create the effect of collapsible groups depending on its state (expanded or collapsed). Basically it's a custom grouping solution: Main advantage is that it consists entirely of datarows (i.e. no GroupByRows) and allows me to do what I need (or so I hope). I'm using the ControlControlEditor to get this to work. Samples found here: http://community.infragistics.com/forums/p/43100/237204.aspx I hope this explains it better.
Let me explain plan B a bit better (I'm implementing this now). I create a usercontrol "CollapseLabel" that displays a button that looks either like a "+" or a "-" followed by some text. Left of the button is an optional margin to create indentation. This control populates my first column. That CollapseLabel will then filter the grid to create the effect of collapsible groups depending on its state (expanded or collapsed). Basically it's a custom grouping solution: Main advantage is that it consists entirely of datarows (i.e. no GroupByRows) and allows me to do what I need (or so I hope).
I'm using the ControlControlEditor to get this to work. Samples found here: http://community.infragistics.com/forums/p/43100/237204.aspx
I hope this explains it better.
Hm, okay, if that works for you. I must be missing something here, though. I'd think it would be a lot easier to simply build a data source that contains the data you want in the appropriate hierarchy and just bind that to the grid. Then you could adjust the appearances on the rows in the first level so that they look different than the "real" data rows underneath them.
By standard grouping, I mean the grouping featured by UltraGrid. The problem with this is that this leads to GroupByRows which cannot contain controls. Using work-arounds like context menu's - although feasible - is not a proper solution I think. Another problem I encountered was that I couldn't show the value being used to do the group by anymore (it was shown in the GroupByRow, but I didn't want it there).
Hi Teun,
I'm not sure I understand either of your solutions.
Teun said:Plan A: Use standard grouping, remove the GroupByRow and enhance the underlying rows. Similair to http://community.infragistics.com/forums/t/40659.aspx. This seems difficult and might not get effect desired.
What do you mean by "standard grouping?" If you mean, don't use GroupByRows, but instead set up your DataSource with a hierarchy, instead, then I'd say that's probably the best way to go. Then you can change the appearance and settings on the rows at the root-level so they are not editable, except in certain fields where you want dropdowns or checkboxes, etc.
If it were just CheckBoxes, then you could probably deal with that manually. All you would have to do is trap for clicks on the CheckBox elements and toggle the state. But if you need a dropdown, also, then that becomes a lot more complex.
Could you possibly use a ContextMenu instead of DropDown? That would be pretty easy to do, and then you could keep using the OutlookGroupBy code you already have and no time would have been wasted.
Teun said:Plan B: Completely customize the first row with a hideable button (to expand, collapse) and indent text as necessary. I can then programmatically control the Grid's filters to hide/show rows OnClick. This is very manual but right now seems to be my best option.
I'm afraid you completely lost me on this one. I don't know what you mean or how this solves the issue.