I try to delete a record from an ultragrid with this two examples:
(1)
ultragrid1:rows:Item[5]:Delete()
(2)
ultragrid1:rows:Item[10]:Selected = true
ultragrid1:DeleteSelectedRows(false).
In both cases the last record in the ultragrid is deleted. When I select two records with the Selected method, then the last two records in the ultragrid are deleted. Somewhere the recordsscope is lost, the delete method points to the wrong record. Can anybody help me?
ThijsSchoemaker said:When I select two records with the Selected method, then the last two records in the ultragrid are deleted
Thanks for your response. What I want to do is point a record in the browse by setting the Selected property to true and and then I want to delete this record.
This is the (OpenEdge) code I use for it:
define variable i as integer.grid_2:rows:Item[3]:Selected = true. do i = 0 to grid_2:rows:Count - 1: if grid_2:Rows:item[i]:Selected = true then grid_2:Rows:item[i]:delete().end.
However, everytime I call the delete method, it deletes the last record from the browse. It have tried to use the UltraGrid.Selected.Rows collection, the DeleteSelectedRows method or the normal delete statement to delete the record I want, but still without the right result. I have installed the UltraWinGrid v 9.1