Hi all,
I have a UltraComboEditor with a custom button added to its ButtonsRight collection. When I embed this editor in a UltraWinGrid the custom buttons Click event is not firing. Is there something that I need to set on the grid to get this working??
What event are you trapping? The grid doesn't have any event for the clicking of an editor button, so you need to use the EditorButtonClick event of the UltraComboEditor. The e.Context param in the event args will tell you which cell is being clicked.
Is there any way of finding out the location co-ordinates of the UltraComboEditors EditorButton from the EditorButtonClick Event?
Yes. The EditorButtonClick event gives you the grid cell. From there you can call GetUIElement to get the UIElement of the cell. From there, you can call GetDescendant and get the element for the button. I'm not sure of the exact type of the button element off the top of my header, bu it's probably something like EditorButtonUIElement. From there you can use the Rect or ClipRect to get the location of the button within the grid.
OK, so I need to use the e.Context object. How do I access the grid cell properties from this Object?
Thanks Mike, I figured that out as soon as I submitted the post, stupid question!!
Cheers,
Denis
Cast it to an UltraGridCell.
In C#:
((UltraGridCell)e.Context)
In VB:
(CType(e.Context, UltraGridCell))