I have a cell within an WinUltraGrid with a ColumnStyle of Button. This is used to show an alternative dropdown (a wintree within a popup - which would be a great new standard feature for the WinGrid control).
This works fine for editing existing rows. When the user wishes to add a new row, they click in one of the cells of the "new row bar" at the bottom (the one with the asterix on it), and start typing. This automatically creates a new row in edit mode.
However, this does not trigger a new row when you press the button in my cell. Is there a way to get this to fire as per a normal combo box cell?
Hi,
I tried this out and I am not sure I undestand what you mean. It sounds like you are talking about the TemplateAddRow in the grid. When I try this and click a dropdown button in the TemplateAddRow, nothing happens to the TemplateAddRow at that point. It does not become a regular AddRow unless and until I change something in the row. If I actually select an item from the dropdown, then the TemplateAddRow becomes an AddRow and a new TemplateAddRow is displayed.
So how is this different with your button cell?
My problem is exactly that! When I press the button it does not add a new row, so when I call:
MyPopup.Show(MyGrid, Me.PointToScreen(MyGrid.ActiveRow.Cells("category").GetUIElement.RectInsideBorders.Location) + New Point(156, 185))
The popup appears located on the cell above with that row now selected instead of the TemplateAddRow. This works for every other row other than the Template one. How can I get the TemplateAddRow to remain selected or else trigger the new row so that it is selected?
Nevermind, I see the difference in what you said. My code now reads:
If MyGrid.ActiveRow.IsAddRow Then
MyPopup.Show(MyGrid, Me.PointToScreen(MyGrid.Rows.TemplateAddRow.Cells("category").GetUIElement.RectInsideBorders.Location) + New Point(156, 185))
MyGrid.Rows.TemplateAddRow.Activate()
End If
This works fine now. Thanks Mike