Sorry -- posted this in the wrong location earlier. Someone please help, if you can!!
I am having difficulty finding how to access the ultragridcell location or the x,y coordinates of the top, left of the cell in the UltraGrid. Why isn't there a location property on the cell? I found an example for accessing the UI element and used the current mouse location out of desperation, and the element returns null when it's on the cell that I want to return!! Anyone have an example of how to do this or can someone even mention what property it is that I need to look at?
CODE THAT DOESN'T GET ME WHAT I'M LOOKING FOR:
UltraGrid grid = (UltraGrid)sender;
Infragistics.Win.UIElement elem = grid.DisplayLayout.UIElement.ElementFromPoint(new Point(grid.DisplayLayout.UIElement.CurrentMousePosition.X, grid.DisplayLayout.UIElement.CurrentMousePosition.Y));
That still doesn't give me the location of the cell. However, pointtoscreen of the grid + the location of the cell inside the grid does. This is close enough, but it still bothers me that it's not easy to get the location of the cell.
PointToClient is a methd on Control. So every control has it, including the UltraWinGrid.
But I don't think that's what you want. The rect of the element are in client coords already. What you want is PointToScreen - which is also on Control.
Yeah -- this is useless to me:
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=1750
And FYI, I did search your KB, I typically do searches BEFORE I post on the forums. Although I understand that's not how most people operate.
I am trying to get the "Location" or X,Y cooridnates of the cell at its absolute position so that I know where to position a popup over that cell.
Again, there's not PointToClient() method, so that's useless. I'm getting closer but still not there with:
UltraGrid grid = ((UltraGrid)sender); CellUIElement element = (CellUIElement)e.Cell.GetUIElement(grid.ActiveRowScrollRegion, grid.ActiveColScrollRegion); Point p = new Point(); p = grpSalesOrder.PointToClient(p); int x = element.RectInsideBorders.X + grid.Location.X + p.X; int y = element.RectInsideBorders.Y + grid.Location.Y + p.Y; frmPopup frm = new frmPopup(x, y);
grpSalesOrder being the first control that I can find with a PointToScreen() call. Which returns negative values (not sure why yet, still researeching).
I'm not usually a UI developer so this is all a bit new for me.
So that's my question, how do I get the absolute X,Y position of the cell??????