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
1130
drag/drop highlight row
posted

I have a wingrid placed inside a panel control.  I allow the user to drag/drop an item from my listbox control into the grid control which resides in a panel control.  How do I highlight the row that the user is currently hovering over until the user drops the item?

My panel.Drag events get fired instead of the grid's.  I managed to get the row highlighted in the grid using the following:

 Private Sub pnlGrid_DragOver(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles pnlGrid.DragOver

 Dim uieOver As UIElement = _healthIssueGrid.grdHealthIssue.DisplayLayout.UIElement.ElementFromPoint(_healthIssueGrid.grdHealthIssue.PointToClient(New System.Drawing.Point(e.X, e.Y)))

If uieOver IsNot Nothing Then

DIm ugrOver  as UltraGridRow = TryCast(uieOver.GetContext(GetType(Infragistics.Win.UltraWinGrid.UltraGridRow), True),  Infragistics.Win.UltraWinGrid.UltraGridRow)

    If ugrOver IsNot Nothing Then

          ugrOver.Appearance.BackColor = Drawing.Color.Yellow

    End If

End If

End Sub

But I can not manage to unhighlight the row once the user moves the mouse over a different row.

Any suggestions would be appreciated.

Dave K.