The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
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++;
}
ADAdministrator Syncfusion Team 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?
ADAdministrator Syncfusion Team 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.