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.
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,
If you still have any concerns or questions I will be glad to help. If you need any additional assistance don’t hesitate to ask.
Regards
gsharm3 said: Is there a way to modify the demo to include the control only in group headers?
- Yes. You could extend the IF condition in the CreationFilter. For example:
public void AfterCreateChildElements(UIElement parent) { HeaderUIElement El = parent as HeaderUIElement; if (El != null && El.Header.Group != null && El.Header.Column == null) { ButtonUIElement newButton = new ButtonUIElement(El); newButton.Text = "X"; newButton.Rect = new Rectangle(El.Rect.X + El.Rect.Width - 20, El.Rect.Y, 18, 18); El.ChildElements.Add(newButton); newButton.ElementClick += new UIElementEventHandler(newButton_ElementClick); } }
public void AfterCreateChildElements(UIElement parent)
{
HeaderUIElement El = parent as HeaderUIElement;
if (El != null && El.Header.Group != null && El.Header.Column == null)
ButtonUIElement newButton = new ButtonUIElement(El);
newButton.Text = "X";
newButton.Rect = new Rectangle(El.Rect.X + El.Rect.Width - 20, El.Rect.Y, 18, 18);
El.ChildElements.Add(newButton);
newButton.ElementClick += new UIElementEventHandler(newButton_ElementClick);
}
I`m not sure that I understand well your second point but if you change the control to TextBox, you could access the properties of this control.
Please let me know if you have any questions.
Thanks Georgi for your sample, it looks promising. A few questions:
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.,