Home Forums WinForms controls Xceed Grid for WinForms Insertion row save dilemma Reply To: Insertion row save dilemma

User (Old forums)
Member
Post count: 23064

After further review, there is still a way this can be a problem. If the insertion row has just been added, but another datarow has not been selected, then the currentrow is an insertionrow and

dr = GridControl1.CurrentRow

generates an error 13.

How can I test in code whether the currentrow is an insertionrow?

Routine is:

Dim dr As Xceed.Grid.DataRow

If ir.IsBeingEdited Then
ir.EndEdit()
Else
dr = GridControl1.CurrentRow
dr.EndEdit()
End If
da.Update(dsDist, “Distributors”)

Imported from legacy forums. Posted by Phil (had 439 views)