Print Page | Close Window

RemoveAt + 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=7998
Printed Date: 20 September 2024 at 1:25am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: RemoveAt + Populate
Posted By: elmsoftware
Subject: RemoveAt + Populate
Date Posted: 13 September 2007 at 3:27pm
Question Setup
When deleting a record from the ReportControl, I use the 'RemoveAt' method.  When done with the 'RemoveAt's, I call the 'Populate' method as recommended by the ReportControl help.
 
    rpt.Records.RemoveAt (Row.Record.Index)
 
    rpt.Populate
 
When I have many rows in the ReportControl and the scrollbar has been scrolled down towards the bottom and I perform a 'delete' on a record using code similar to the above snippet, the Populate method refreshes the whole ReportControl with focus now on the top record.  This is undesirable and not the typical user experience when working with lists/grids.
 
What I would like is for the ReportControl to Remove just the row that has been deleted and keep all previous rows visible just the way they were.
 
What is the recommended way of doing this?
 
All the best,
 
John



Replies:
Posted By: nighthawk
Date Posted: 13 September 2007 at 7:40pm
How about:

lngTopRow = rpt.TopRowIndex
rpt.Records.RemoveAt (Row.Record.Index)
rpt.Populate
rpt.TopRowIndex = lngTopRow


Posted By: elmsoftware
Date Posted: 14 September 2007 at 8:51am
Thanks Nighthawk...much appreciated!



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