Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - RemoveAt + Populate
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

RemoveAt + Populate

 Post Reply Post Reply
Author
Message
elmsoftware View Drop Down
Groupie
Groupie
Avatar

Joined: 21 November 2006
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote elmsoftware Quote  Post ReplyReply Direct Link To This Post Topic: RemoveAt + Populate
    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
Back to Top
nighthawk View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 June 2004
Status: Offline
Points: 167
Post Options Post Options   Thanks (0) Thanks(0)   Quote nighthawk Quote  Post ReplyReply Direct Link To This Post Posted: 13 September 2007 at 7:40pm
How about:

lngTopRow = rpt.TopRowIndex
rpt.Records.RemoveAt (Row.Record.Index)
rpt.Populate
rpt.TopRowIndex = lngTopRow
Back to Top
elmsoftware View Drop Down
Groupie
Groupie
Avatar

Joined: 21 November 2006
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote elmsoftware Quote  Post ReplyReply Direct Link To This Post Posted: 14 September 2007 at 8:51am
Thanks Nighthawk...much appreciated!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.250 seconds.