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.

Scrolling for Drag and Drop in GridDataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

24980 Feb 15,2005 04:07 PM Feb 16,2005 11:56 AM Windows Forms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On February 15, 2005 04:07 PM

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 06:18 PM

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 11:01 AM

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 11:56 AM

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.

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.

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.

;