Hi,
We'd like to put a control in the group header area - for example a textbox to specify an offset to apply to all values for every group.
We're wondering how feasible this is within the existing infrastructure of the UltraGrid control, and if you have any recommendations on how to achieve this.
Thank you.
Hello,
Maybe one possible way to achieve desired behaviour could be if you are using CreationFilter. I have similar sample where I`m using this approach. Could you please take a look at the attached sample and let me know if you have any questions.,
Regards
Thanks Georgi for your sample, it looks promising. A few questions:
Thanks Georgi. I'm still having trouble having it work exactly how we'd like.
Please see attached solution with modified version of your sample to better illustrate our use case.
What we'd like to have is
I hope very much you are able to help us in this scenario. So far I'm unable to get the textbox to appear in the right position and repeat above each column.
Hello Gsharm3,
Thanks for provided details, but this is very custom scenario and we have not such kind functionality. Nevertheless I made small sample for you with desired behavior. This sample is just an idea how to achieve your requirements. Please take a look at the attached sample and video file for more details and let me know if you have any questions.
Thank you Georgi, this is very close to what we want. However, a few issues we've noticed:
gsharm3 said:When we scroll in this demo using the mouse wheel, we get some screen corruption, as textboxes appear all over the grid in the wrong places. Is there a way to prevent this? Curiously, the problem doesn't appear if we use the scrollbar instead of the mouse wheel.
Hm. You are right. I forgot for this scenario. I didn`t remove the TextEditors. Just modify my Creation fIlter to remove the TextEditors before start draw it again and eveything should works properly
gsharm3 said:Text editors appear also for higher-level groups. For example, next to AAPL we have a text box which does not directly contain datarow items. Is it possible to hide this, and only show it for the lowest leaf-level groups that have datarow children?
Yes, It is possible. You could extend the IF condition in the Creation Filter and exclude this row (you could check this using property IsGroupByRow and Decription).
Please let me know if you have any questions.
Thanks Georgi, that's helpful - a few more things:
gsharm3 said:Is there a way to determine if an UltraGridGroupByRow is a leaf-level group by row (i.e. has further no child group by rows). The IsGroupByRow and Description properties don't seem to help in this regard - we're wondering if there's anything else?
There are many approaches to solve this taks. In the sample I just exclude these rows on depend of the Value. Please take a look in the sample for details
gsharm3 said: Could you advise on the best way to modify your Creation fIlter to remove the TextEditors before it starts to draw it again?
Maybe one possible approach could be if you are using the code:
foreach (Control cnt in grid.Controls) { DependentTextUIElement UI = grid.DisplayLayout.UIElement.ElementFromPoint(cnt.Location) as DependentTextUIElement; if (cnt.GetType() == typeof(UltraTextEditor) && UI == null)// && !IsScrol) { grid.Controls.Remove(cnt); } }
foreach (Control cnt in grid.Controls)
{
DependentTextUIElement UI = grid.DisplayLayout.UIElement.ElementFromPoint(cnt.Location) as DependentTextUIElement;
if (cnt.GetType() == typeof(UltraTextEditor) && UI == null)// && !IsScrol)
grid.Controls.Remove(cnt);
}
Please take a look at the modifications in the sample for more details.
gsharm3 said:Can we can the textboxes to appear for every column (we noticed the coordinates are currently hardcoded with an 80 pixel offset for just 1 of the columns).
Yes. It is possible. Just replace the hardcoded offset with the Cell`s X location from Rect property
Update: we're using this method - let us know if you know of a better way:
GroupByRowDescriptionUIElement groupByRowDescriptionUiElement = parent.Parent as GroupByRowDescriptionUIElement;
UltraGridGroupByRow ultraGridGroupByRow = groupByRowDescriptionUiElement.GroupByRow;
Debug.WriteLine(">> ultraGridGroupByRow.ChildBands.FirstRow: " + ultraGridGroupByRow.ChildBands.FirstRow);
if (ultraGridGroupByRow.ChildBands.FirstRow.GetType() != typeof(UltraGridGroupByRow))
{ code for setting up text editor }