Deleting Incorrect Row |
Post Reply |
Author | |
XiMaker
Groupie Joined: 11 December 2009 Location: United States Status: Offline Points: 23 |
Post Options
Thanks(0)
Posted: 06 May 2010 at 1:09pm |
I have an odd issue where I am deleting records from the reportcontrol and everything works like it should most of the time but at some point even when nothing else has changed, it will start deleting rows 2 or 3 lines below where the focusedrow is located. during the debug phase I can see that the selectedrow.record contains the correct information that should be deleted but when I issue the removeat and then populate the row 2 or 3 lines below will go away. if I try to delete the same row again it throws an error like the correct row does not exist but it is showing on the reportcontrol row. ANY IDEAS?
|
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
Possibly you want rptMainMessages.Records.RemoveAt(row.Record.Index); rptMainMessages.Populate(); OR rptMainMessages.RemoveRecordEx(row.Record.Index); rptMainMessages.RowEx(row); OR Sub Delete() Dim i As Long, Row As ReportRow If lst.SelectedRows.Count = 0 Then If lst.Records.Count = 0 Then Debug.Print "No Row(s) Exist to Remove" Else Debug.Print "Select The Row(s) you want to remove" End If ElseIf lst.SelectedRows.Count >= 1 Then Debug.Print "Ready TO Remove : " & lst.SelectedRows.Count & " Row(s)" If MsgBox("Are You Sure", vbInformation + vbYesNo) = vbNo Then lblStatus.Caption = "Remove cancelled" Exit Sub End If For Each Row In lst.SelectedRows Delete Row lst.Records.RemoveAt (Row.Record.Index) Next Debug.Print "Selected Rows removed successfully" lst.Populate End If End Sub |
|
XiMaker
Groupie Joined: 11 December 2009 Location: United States Status: Offline Points: 23 |
Post Options
Thanks(0)
|
using the rptMainMessages.RemoveRecordEx(row.Record.Index); seems to have done the trick - I was consistently having the problem before using the RemoveAt and have not been able to reproduce the problem at all when using RemoveRecordEx - thanks...
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
Is your issue related to https://forum.codejock.com/forum_posts.asp?TID=11560 Are you removing records within the SelectedRows collection? If I remove a record with .RemoveRecordEx(row.record) or .RemoveAt(row.record.index) method shouldn't make a difference. Can you show code you used when it didn't work?
Thanks
|
|
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.... |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |