Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
85
Determine when dragging rows over header region
posted

I have an UltraWinGrid with several drag & drop events.  In the _DragOver event, I'm drawing a rectangle around the current drop row (there are hidden rows between each row that allow the user to drop "between" two visible rows, so we highlight whether or not they are "on" the row or "between" rows).  When I drag the row up into the header, the rectangle continues to be drawn, but I don't want it to be shown.  How can I determine when I am over the header and not run any of my other code (drawing the rectangle, etc...)?

 

Thanks,

Ryan

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi Ryan,

     Your code is probably detecting the row by using ElementFromPoint and then calling GetContext to get the UltraGridRow. The column header elements will return the first row in the collection as their context. So what you need to do is check for a RowUIElement before you call GetContext. ElementFromPoint might return a RowUIElement. If not, use GetAncestor to see if there is a RowUIElement in it's parent chain. If not, don't show your highlight because you are not over a row. 

     

Reply Children