Geeks With Blogs
O(geek) Ryan Cain, running in time proportional to Geek.

I ran across this following bug on WindowsForms.com, while having the same *exact* issue in a control I had created for an app.  This was posted by SteveOrr:

http://www.windowsforms.com/Forums/ShowPost.aspx?tabIndex=1&tabId=41&PostID=23285

1) Start IssueVision
2) in the middle pane select the top item in the second "Computer" group.
3) Then click on the last item in the above group "Telecommunications."
Notice you'll see the list "jump" and draw the Telecommunications group starting at the top, when the top of that section had scrolled off the screen.
It is disorienting to the user for their selection to be moved to a new location when they click on it.

Worse, if you adjust the data so that there is more than a full screen's worth of data in the top "Telecommunications" group and then follow the above instructions then the item you select will be scrolled completely off the screen as soon as you select it.
This is an unacceptable user experience.

I've looked all through the code trying to fix this bug, but I find no references to any scrollbars or anything else that looks like it would be helpful to keep the list from auto-scrolling.

Does anyone have any idea why this is happening or how to fix it?

 

This was my response:

I was about to post yesterday that I was having the same problem.  We've use the IssueList as a base for a listview we've created and had the same exact issue in our control.  It was getting really frustrating because most cases we only had one group and would have 100 - 200 items in that group.  So the you would scroll to the bottom 200 items down and then click, of course the view would jump right back to the top. 

I think we've found a solution here to this problem.  It has to do when you click on a different section control.  That control becomes active.  When the active control changes and the AutoScroll is set to true it looks like a series of internal work happens that looks for the Top,Left point of the new active control.  Of course this doesn't always work well for this IssueVision control, because the Top/Left corner of the Section Control could be hundreds or thousands of pixels away from the item we just selected. 

To fix the prob. we ended up settling on making sure the control just didn't scroll at all when the active control changed.  This looks like the same behavior Outlook has.  To do this just add the following lines of code to the IssueList, or prob the ExpandableList:

protected override Point ScrollToControl(Control activeControl)
{
    return this.AutoScrollPosition;
}

It looks like that protected method is called each time the active control changes, and requests a new position to scroll to.  Rather than scrolling to the top/left of the control (which if you use Reflector you'll see the base class method does essentially), you can move to any point you wish.  We just decided to use the last scroll position so nothing moves. 

 

I couldn't find anything on Google about the issue, so hopefully this will get out there and help anyone else who has a similar issue.  Not knowing the nitty gritty details of the ScrollableControl base class it took a while to figure this out. 

Posted on Thursday, February 17, 2005 11:53 AM .NET 1.0/1.1 | Back to top

Related Posts on Geeks With Blogs Matching Categories

Comments on this post: IssueVision Scrolling Problem

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Ryan Cain | Powered by: GeeksWithBlogs.net