Hi All,
I got requirement in displaying icon in row header near to the row selection indicator (attached screenshot) based on some condition.
Is there any possibility to add a button in the row header so that user can interact with it.
Please share me any example if possible.
Thank you,
Sundaram.
Hello and thank you for contacting Infragistics.
There isn't anything out of the box to achieve this without using something like a creation/draw filter customize the control.
You can suggest new product ideas for future versions (or vote for existing ones) at <https://es.infragistics.com/community/ideas>. Submitting your idea will allow you to communicate directly with our product management team, track the progress of your idea at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you. Remember when submitting your idea to explain the context in which a feature would be used and why it is needed as well as anything that would prevent you from accomplishing this today. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it.
Let me know if you have any questions.
Michael DiFilippoSoftware DeveloperInfragistics, Inc.
Hi Michael,
Thanks for your response.
After investigating further me too thought to use creation/draw filter.
I have tried with creation filter as below.
public class RowHeaderIconIndicatorsCreationFilter : IUIElementCreationFilter { public RowHeaderIconIndicatorsCreationFilter() { } public void AfterCreateChildElements(UIElement parent) { if (parent is RowSelectorUIElement) { RowSelectorUIElement header = (RowSelectorUIElement)parent; bool isSelected = ((parent.Parent as RowUIElement).Row.ListObject as EmployeeData).IsSelected; if (!isSelected) return; Infragistics.Win.ButtonUIElement button = new ButtonUIElement(parent); Rectangle parentRect = parent.RectInsideBorders; button.Rect = new Rectangle(parentRect.X + parentRect.Width - 10, parentRect.Y, 10, 10); button.Text = "\u0007"; button.TextHAlign = HAlign.Center; button.TextVAlign = VAlign.Middle; button.ElementClick += new UIElementEventHandler(button_ElementClick); parent.ChildElements.Add(button); } } void button_ElementClick(object sender, UIElementEventArgs e) { MessageBox.Show("Button clicked"); } public bool BeforeCreateChildElements(UIElement parent) { return false; } }
it is working fine, but i have requirement to open popup when user double click on the button UI element
I didn't see any double click event . is it possible to achieve it?
How we can use draw filter for my requirement?.
Thanks
ButtonUIElement does not have a double click event but you'll need to somehow identify between a single click or double click with a timer.
eg.
https://stackoverflow.com/questions/38343814/c-how-to-avoid-double-click-when-i-need-single-click
I would use the DoubleClick event on the control.
You could check grid.DisplayLayout.UIElement.LastElementEntered and if that element (or more likely one of it ancestors) is a ButtonUIElement, you could then use GetContext to get the UltraGridCell and respond. Although, personally, I think it's a little weird to show a context menu on a double-click. It's standard Windows behavior to show Context menu on a right-click using MouseUp.