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

Performance: Virtual Grid + VerticalThumbTrack=true + VScrollPixel=true

Thread ID:

Created:

Updated:

Platform:

Replies:

32972 Aug 10,2005 06:15 PM UTC Aug 10,2005 09:57 PM UTC Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On August 10, 2005 06:15 PM UTC

Hi Clay, I am using VS 2005 B2 and Syncfusion 3.2.1.515. I don''t have any problem, I am just curious about a particular scenario. In the small project I attached is a virtual grid with at row count of 500,000. When VScrollPixel is on the scrolling is very slow compared to when it is off. Would you happen to know what is causing the slowdown? Thanks WindowsApplication30_1359.zip

Administrator [Syncfusion]
Replied On August 10, 2005 09:15 PM UTC

Kevin, The grids base class pixel scrolling is not optimized for such large row scenarios. In the derived GridGroupingControl we have overriden a couple of virtual methods to make it perform well and use binary tree structures to quickly get the row index for a absolute pixel position and the other way around. With the base grid if you do not have individual row heights and instead all rows are the same height you can get the scrolling to be the same speed as non-pixel scrolling when you override the same methods as follows: public class DerivedGridControl : GridControl { public override int RowIndexToVScrollPixelPos(int rowIndex) { // Taking separate height for column header into account. rowIndex = Math.Min(rowIndex, Model.RowCount); if (rowIndex > 0) return (rowIndex - 1) * Model.Rows.DefaultSize + Model.RowHeights[0]; else return Model.RowHeights[0]; } public override int GetVScrollPixelHeight() { if (Model.RowCount == 0) return 0; return (Model.RowCount - 1) * Model.Rows.DefaultSize + Model.RowHeights[0]; } public override void VScrollPixelPosToRowIndex(int pixelPos, out int rowIndex, out int pixelDelta) { if (pixelPos < pixelPos - Model.RowHeights[0]) { rowIndex = 0; pixelDelta = pixelPos; } rowIndex = (pixelPos - Model.RowHeights[0]) / Model.Rows.DefaultSize + 1; pixelDelta = (pixelPos - Model.RowHeights[0]) % Model.Rows.DefaultSize; } } I attached a modified sample with these changes: VScrollpixelGridWithManyRows.zip Stefan >Hi Clay, > >I am using VS 2005 B2 and Syncfusion 3.2.1.515. > >I don''t have any problem, I am just curious about a particular scenario. In the small project I attached is a virtual grid with at row count of 500,000. When VScrollPixel is on the scrolling is very slow compared to when it is off. Would you happen to know what is causing the slowdown? > >Thanks > >WindowsApplication30_1359.zip >

Administrator [Syncfusion]
Replied On August 10, 2005 09:57 PM UTC

Stefan, Wow, great answer. I understand what you mean, and that solution works perfectly. Thanks for taking the time to modify the sample.

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

;