Core.UIItems.Scrolling.ScreenItem.MakeVisible() scrolls ListView up at each row.Cells[i] access

Jul 7, 2009 at 3:35 PM
Edited Jul 7, 2009 at 3:36 PM

Hello,

I would like to suggest some modification to Core.UIItems.Scrolling.ScreenItem.MakeVisible() method. It does scroll grid up to first element and then back even if row is currently visible. That reduces grid row walkthrough (i.e. foreach cycle on all rows, accessing row.Cells[index] at each iteration) dramatically (2 rows per second). I suggest to swap two blocks of code which are currently:

 

 

            if (verticalScroll.IsNotMinimum)
{
verticalScroll.SetToMinimum();
verticalSpan = verticalSpanProvider.VerticalSpan;
WhiteLogger.Instance.DebugFormat("Scroll Position set to minimum value.");
}

if (verticalSpan.Contains(uiItem.Bounds))
{
WhiteLogger.Instance.DebugFormat("UIItem ({0}) whose bounds are ({1}) is within bounds of parent whose vertical span is {2}", uiItem,
uiItem.Bounds, verticalSpan);
return;
}

 

to

 

            if (verticalSpan.Contains(uiItem.Bounds))
{
WhiteLogger.Instance.DebugFormat("UIItem ({0}) whose bounds are ({1}) is within bounds of parent whose vertical span is {2}", uiItem,
uiItem.Bounds, verticalSpan);
return;
}

if (verticalScroll.IsNotMinimum)
{
verticalScroll.SetToMinimum();
verticalSpan = verticalSpanProvider.VerticalSpan;
WhiteLogger.Instance.DebugFormat("Scroll Position set to minimum value.");
}


 

In that case grid does not scroll up at each row processing.

What do you think on possible problems after that change?

Jul 9, 2009 at 12:53 PM

If this is a solution, please integrate it in the next build, because the scrolling action on great lists leads to a bad performance :)

 

Throndorin

Coordinator
Jul 11, 2009 at 9:35 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Jul 23, 2009 at 2:27 PM

I think this a part of this issue :)

WorkItem 3593