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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Scrolling for Drag and Drop in GridDataBoundGrid

Thread ID:





24980 Feb 15,2005 09:07 PM UTC Feb 16,2005 04:56 PM UTC WinForms 3
Tags: GridControl
Administrator [Syncfusion]
Asked On February 15, 2005 09:07 PM UTC

My GridDataBoundGrid control has several rows of data and I have to scroll down to get to the last row.I''m trying to drag a cell from the top of the grid to a row that is not currently visible in the grid ( because of the scroll position). When I drag beyond the grid control border, I expected it to scroll automatically. This does not happen. How do I achieve this? Thanks

Sue Harris
Replied On February 15, 2005 11:18 PM UTC

I achieve the auto scrolling by handling the DragOver event. The actual scrolling part is done with the following code, however theres also code in my function (which I haven''t posted here for size reasons) to ensure that it happens at a nice speed and draws nicely afterwards. bool hasScrolled = false; if(col == this.LeftColIndex && col > this.Model.Cols.FrozenCount + 1) { hasScrolled = true; base.LeftColIndex--; } else if(col == this.ViewLayout.LastVisibleCol && this.ViewLayout.HasPartialVisibleCols) { hasScrolled = true; base.LeftColIndex++; } else if(row == this.TopRowIndex && row > this.Model.Rows.FrozenCount + 1) { hasScrolled = true; base.TopRowIndex--; } else if(row == this.ViewLayout.LastVisibleRow && this.ViewLayout.HasPartialVisibleRows) { hasScrolled = true; base.TopRowIndex++; }

Administrator [Syncfusion]
Replied On February 16, 2005 04:01 PM UTC

Thanks. I did try this method before. I had used ScrollCellInView method. I also tried what you had suggested, but I just can''t get the grid to refresh. Methods Refresh, RefreshRange, Invalidate does not seem to work. Am I missing anything?

Administrator [Syncfusion]
Replied On February 16, 2005 04:56 PM UTC

I figured it out. You have to call EndUpdate() before refreshing if you scroll programatically. Apparently, BeginUpdate is being called when the dragging operation starts.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon