We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Highlining current row on DragOver event GridTreeControl

Thread ID:

Created:

Updated:

Platform:

Replies:

124566 Jun 15,2016 06:27 AM UTC Jun 16,2016 01:48 PM UTC WPF 1
loading
Tags: GridTreeControl
John
Asked On June 15, 2016 06:27 AM UTC

Hello,

I have a problem with highlining current row on DragOver event.

I have tryied something like this, but it doesn't work:
       
 int hoveredIndex = -1;

private void AssociatedObject_DragOver(object sender, DragEventArgs e)
        {
            Point p1 = e.GetPosition(this.AssociatedObject.InternalGrid);
            RowColumnIndex rc = this.AssociatedObject.InternalGrid.PointToCellRowColumnIndex(p1);
            hoveredIndex = rc.RowIndex;
        }

        private void InternalGrid_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
        {
            if (e.Style.RowIndex == hoveredIndex)
            {
                e.Style.Background = System.Windows.Media.Brushes.Black;
            }
        }



Jai Ganesh S [Syncfusion]
Replied On June 16, 2016 01:48 PM UTC

Hi John, 
 
You can highlight the current row on DragOver event by call the InvalidateMeasure method like below, 
 
  private void TreeGrid_DragOver(object sender, DragEventArgs e) 
     { 
            Point p1 = e.GetPosition(this.treeGrid.InternalGrid); 
            RowColumnIndex rc = this.treeGrid.InternalGrid.PointToCellRowColumnIndex(p1); 
            hoveredIndex = rc.RowIndex; 
 
            this.treeGrid.InternalGrid.InvalidateMeasure(); 
      } 
 
If you still facing the issue, then could you please share the whole code for doing drag and drop in your application? This would be more helpful for us to analyze further. 
 
Regards, 
Jai Ganesh S 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;