Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
125
Problems with deleting rows from Ultragrid
posted

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?

Parents
No Data
Reply
  • 69832
    Suggested Answer
    Offline posted

    ThijsSchoemaker said:
    When I select two records with the Selected method, then the last two records in the ultragrid are deleted

    This is to be expected if you use the DeleteSelectedRows method; as the names implies, it acts on each member the UltraGrid.Selected.Rows collection. I'm not clear on exactly what you want to do, but you can call UltraGrid.Selected.Rows.Clear before selecting a row if you want to ensure that that row is the only selected one. You could also set the UltraGrid.DisplayLayout.Override.SelectTypeRow property to 'Single' to disallow multiple row selection altogether. If I misinterpreted your intention please repost with additional details about what you are trying to accomplish and we can try to help.

Children