Posted 31 January 2019, 12:45 pm EST
I’m working with a data-bound TrueDBGrid. The row data comes from a class we created. One of the members of this class is a mailing address (which is a class with four string properties). I created a custom editor containing 4 text boxes in a panel (extending UserControl and implementing IC1EmbeddedEditor).
For existing rows in the grid, clicking on the mailing address cell opens the editor, allows me to make changes, then passes the change back to the object represented by the row in the grid. In other words, it works as expected.
However, creating a new row in the grid doesn’t work properly (it worked properly before moving from individual properties/columns for the four mailing address lines). Instead, when I click on the mailing address cell in the “*” row, it creates a row and opens the custom editor. It allows me to make changes. But when the custom editor closes, the new row is removed and the new object is removed from the underlying list.
If, instead of starting with the mailing address, I start with a different column that doesn’t have a custom editor, the new row will stay around until I attempt to edit the mailing address at which point it is removed after editing.
I can only manage to keep the new row if I start by editing a column other than mailing address, then move to a different row, then move back to the row I created.
Any pointers would be appreciated.