Print Page | Close Window

Preserve focus in a specific row after re-populate

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=10363
Printed Date: 20 September 2024 at 8:51am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Preserve focus in a specific row after re-populate
Posted By: braian87b
Subject: Preserve focus in a specific row after re-populate
Date Posted: 25 April 2008 at 1:43pm
i need to know the correct method to, after populate the list, set the top-row (visible at the top of the list) and the already focused, to preserve the position and the focused row/record when i perform an list update (removing all rows and re-populating the list)
 
info: i always have in the firsth Item of the record the ID of the table of the database and has to be related to the ID
note: does not matter the first visible record, but is important the focused record visible in the list (EnsureVisible Method for Example).
 
Example:
 
List:
ID             Name                LastName
10              Jonh                  Kirk    < FirstVisible Record example
11              Jonh                   Black
12              Stephan             Clark < Focused/Selected Record
13              Pedro                 Lopez
15              Alexander          Stope
 
After the Update (or a classic F5 - Refresh)
 
Updated List:
ID             Name                LastName
09              Charles             Dawn
10              Jonh                  Kirk   
12              Stephan             Clark < Focused/Selected Record
13              Pedro                 Lopez
14              Steven              Hawken
 
note: in this example the record 11 was deleted and the record with ID 14 was inserted
i want to preserve the focus in the record with ID 12
 
 
(Sorry for my Ligth English)
Please, put (if you can) a code-example/snippet
 



Replies:
Posted By: Aaron
Date Posted: 29 April 2008 at 10:11am
Hi,
 
I don't know if the versions are different with FocusedRows but in V11.2 the FocusedRow will keep the focus all the time (grayed) also when deleting records. If your version doesn't do this you have to store a reference of the selected record and if you populate again, "select" the stored record.
 
And maybe it's a good idea to upgrade your version, there are wonderfull features in version V12.0 (you have to wait a few days for the official release)
 
 



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