Print Page | Close Window

initial position on x axis of a grid

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=10657
Printed Date: 20 September 2024 at 10:39am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: initial position on x axis of a grid
Posted By: tmartinson
Subject: initial position on x axis of a grid
Date Posted: 16 May 2008 at 2:20pm
Is there a way to preserve where the slider is on a reportcontrol grid?

We have a grid with more fields (columns) than can physically fit on the screen, so a slider is generated to get to the fields on the right.    When a user presses page down we clear the grid and load new records.  The problem is if they scrolled  (left to right) anywhere on the line of a report control grid, the place the user was looking is not preserved to where it was before the pressed the key, and they have to slide to the right to see the column they were looking at.

I tried setting the focus to the a particular column, but this does not preserve where the user was (left to right) on the screen before
a page down, for example was pressed.

Does anyone have any ideas?

We are using Xtreme Report Control for Acitve X version 11.1.3.

Thanks,
Tom



Replies:
Posted By: Aaron
Date Posted: 16 May 2008 at 3:40pm
Hi,
 
Try this:
 
wndReportControl.Columns(4).EnsureVisible
 
or
 
wndReportControl.Navigator.MoveToColumn 4
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: tmartinson
Date Posted: 20 May 2008 at 5:31pm
I fear I must be missing the obvious.   When I tried using movetocolumn or ensurevisible, I got the field being referred to be in focus not necessarily anywhere specifically on the screen.    I have tried using the navigator to move it all the way to the right and other such things, but the  column that is on the left is never guaranteed to be the one I want.



Example: I have name, address, city, state, zip on each line. The user  has scrolled over to the city field.  Since name and address are too big you can only see the city, state and the first part of the zipcode on the screen.  (you would see name and address if you moved the slider to the left)

When the user hits a page down, I want to load the next set of records in, clear the screen and position the of the slider in such
a way that the field "city" is still  the left-most column.  (in other words I want to column headings to "change" back to where they were before I cleared the screen).

As it is now, I have to move the slider back to where it was before I can see the column I was looking at.

Thanks,
Tom


Posted By: Aaron
Date Posted: 21 May 2008 at 3:19pm
Hi,
 
I can't reproduce your problem in any way, I have been trying to get the same problem you have, but I can't. This control is so fantastic that I can't produce the problem  
 
At first I thought it was the repopulating of the ReportControl but it seems that the scrollbar maintains it's position after populating. I found out just before I want to give up.
 
Please check the sample and add the code that will reproduce your problem
 
 
https://forum.codejock.com/uploads/20080521_152023_TestColumns.zip - uploads/20080521_152023_TestColumns.zip


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: tmartinson
Date Posted: 22 May 2008 at 5:09pm
Thanks for the example!

I loaded Visual Basic on my machine and then entered code similar to
the code in our library and fixed the problem.  

There was a grid.coulumns.deleteall() in the code that I had not noticed before.  (it was in a function written by a consultant we had here a year ago)

Even though the problem was 100% my stupidity I thank you for
the example.   You motivated me to get Visual Basic on my machine.  I think is a lot simpler to use Visual Basic than our main environment.




Posted By: Aaron
Date Posted: 23 May 2008 at 12:13am
Hi,
 
Only deleting columns will have the effect you mentioned, thats true.
Well I'm glad it works


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net