Hi, I have a couple of xamdatagrids in a master detail scenario, with the detail grid allowing users to enter in new data. In many cases I am able to predict the values that the user will enter, and I want to pre-enter those values into the new record as a suggestion. This way if the application predicts correctly, the user could just click on the plus icon in the grid and the new row would get committed to the table without the user having to enter in any data. I am using the InitializeTemplateAddRecord event to prepopulate the new record and that is working fine. However, I am having some difficulty making the grid commit this row to the table.
My understanding from other forum posts is that the business object does not get created until the user actually starts typing into one of the cells. Because of this behavior even if all the cells are populated with valid data just selecting one of the cells and pressing enter does not emit the usual pair of RecordAdded/Updated events. I discovered I have to type something (anything, even if the data is exactly the same as what was already in there!) to get the grid to create my business object and commit it to the table.
I may be adding an additional column to the table with an "add" button or I might just rely on the plus icon that comes with the xamdatagrid, but either way I need a little help figuring out how to get a fully prepared record to insert the grid. Thanks!
Hello,
For this, we have exposed a XamDataGrid.RecordManager.CommitAddRecord() which will commit the values of the cells inside the Add new Record without having to manually input values in it.