Performance: Virtual Grid + VerticalThumbTrack=true + VScrollPixel=true
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
SIGN IN To post a reply.
2 Replies
AD
Administrator
Syncfusion Team
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
>
AD
Administrator
Syncfusion Team
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.
SIGN IN To post a reply.
- 2 Replies
- 1 Participant
-
AD Administrator
- Aug 10, 2005 06:15 PM UTC
- Aug 10, 2005 09:57 PM UTC