Hi
Can i get the width of certain column of an ultrapivot grid? Or the width of a certain cell?
Are those widths resizeable?
Thanks!
You are right. The question is WHEN. And I need in an AfterDraw event, I mean, when the table is already populated. The creation filter doesn´t give me the info I want.
For example, the UltraGrid component provide this info of the col width.
Any other ideas?
What should I do? Launch it as a product idea?
Thanks again.
Thanks! I will try it and tell you what I get.
Okay. I'm trying to explain that it's probably not that simple. How you get the width depends a lot on WHEN you need to get it and what you are going to do with it.
But if you are not interested in any of that and you just want to get the width, you can probably use a CreationFilter like this:
this.ultraPivotGrid1.CreationFilter = new MyCreationFilter(); class MyCreationFilter : IUIElementCreationFilter { void IUIElementCreationFilter.AfterCreateChildElements(UIElement parent) { if (parent is UltraPivotGridUIElement) { var rowDropAreaUIElement = parent.GetDescendant(typeof(RowDropAreaUIElement)); if (null != rowDropAreaUIElement) Debug.WriteLine(rowDropAreaUIElement.Rect.Right); } } bool IUIElementCreationFilter.BeforeCreateChildElements(UIElement parent) { // Do nothing return false; } }
I just need the distance of the width of the Measure column or the the width of the left fixed columns or the width of the Group_Y_1 column. The three of the are the same distance. Take a look at the picture.
I don't think that's possible. A CreationFilter can allow you to modify the position, size, or contents of a UIElement. But inserting an additional row would be extremely diffficult, because you would have to move essentially every other element in the entire grid in order to *** everything else down. Since the CreationFilter only affect the painting of the control and not the actual metrics, this would, in turn, cause the scrollbars not to function properly. Maybe I a misunderstanding what you want, though. If you are just talking about placing a Label control or something like it on top of the PivotGrid at a particular position, without moving any of the objects in the PivotGrid itself, then that might be doable.
But again, the criteria is a little tricky. You seem to be suggesting that your PivotGrid is fixed and that the user cannot change which columns you are using. If that's the case, and you will ALWAYS be using IT11 and IT12 and the same grouping, then it might be doable. Is that the case? Could you post a screen shot that mocks up what you want?