Hi
I have seen in these posts how to get the node from the MouseEnterElement event. But, how do I get the column at the current mouse position?
Thanks
Jerry
If you meant a column for the WinGrid then please refer to the following link:
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=1728
If you need further assistance with this question, please submit a support request to Infragistics Developer Support.
Actually, I did put this post in the right forum becasue I do want to the column of the rowset in where the mouse is currently located.
But, I didn't explain why. Actually, what I am trying to achieve is to show a tool tip which is column dependant. So, I have three different column sets in my tree. The column headings would be OK, if they only displayed at the top of each change in column set, but I can't get that to happen, it seems that they show above every row which looks a complete mess.
So, if we can't show the headings, then we ought to be able to show a tooltip instead. Now, the tooltip should simply display the column heading name of the column for the cell over which the mouse is hovering.
Hence my desire to get the column from the mouse position.
Can I do this?
I can send to IG support if preferred...
Hi Jerry,
Something like this:
private void ultraTree1_MouseMove(object sender, MouseEventArgs e) { UltraTree tree = (UltraTree)sender; Point p = new Point(e.X, e.Y); UIElement element = tree.UIElement.ElementFromPoint(p); if (element != null) { UltraTreeNodeCell cell = element.GetContext(typeof(UltraTreeNodeCell)) as UltraTreeNodeCell; if (cell != null) { UltraTreeNodeColumn column = cell.Column; } } }
You may want to check out the Infragistics UIElementViewer Utility. It's a big help when working with UIElements like this.
Mike
Thanks for that - I'll try that shortly.
Regards
Magued
Fantastic!
Works fine - greate site you put me onto.
Thanks loads.
Private Sub ultraTree1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs)
Dim tree As UltraTree = DirectCast(sender, UltraTree)
Dim p As New Point(e.X, e.Y)
Dim element As UIElement = tree.UIElement.ElementFromPoint(p)
If element IsNot Nothing Then
Dim cell As UltraTreeNodeCell = TryCast(element.GetContext(GetType(UltraTreeNodeCell)), UltraTreeNodeCell)
If cell IsNot Nothing Then
Dim column As UltraTreeNodeColumn = cell.Column
End If
End Sub
Please refer to the following site for conversion from C# to VB.NET
http://labs.developerfusion.co.uk/convert/csharp-to-vb.aspx
Hmm
Mike, I have tried to do this but my c# is not good and I am trying to convert your code to VB - any chance you can help?