DeleteCurrentRow not deleting current row


Author
Message
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I have a BO that I have attached to a user control and am doing a delete operation on it from within the user control.  I set the BO to the record I wish to delete and then call BO.DeleteCurrentRow(False).  This seems to be deleting the last record in the BO every time regardless of what row it is currently on.  I can look at the data in the BO and it matches the row I wish to delete (the current row) right before DeleteCurrentRow is called, but it doesn't delete that row.  Any ideas as to why this could be occurring?  Thanks
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Do you have any code in the BeforeDelete event or is there something that could be firing in your environment that is moving the record pointer?  To make sure that to BO is OK, create a new form, drop the BO on the form, and manually populate the BO.  Add a button to delete the current row.  Does it delete only the last record? 

Is the BO that you are deleting from tied to a grid? 

Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
OK, I think I got it.  The current row on the BO was getting moved because the CustomColumnDisplayText event was firing on a grid which was calling a MoveAbsolute on the BO.  I just restructured the code so it wouldn't have to change rows and it now deletes the correct row.  Thanks for the help.
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Sure...it is generally some event moving the record pointer when you see a symtom like that.  Glad you found it Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search