Hi,
We upgraded our project from NetAdvantage v11.2 to v14.2 and we see this issue. In our MVVM based application, we have a grid which has XamComboEditor in the first field, followed by fields with Buttons, couple of other XamComboEditors etc. The first field is bound to an ObservableCollection of custom class objects. If a particular value is selected then the values for other XamComboEditors fields and couple of other text fields are set. This is done in the XamComboEditor's SelectedItemChanged event and we do ExecuteCommand(DataPresenterCommands.CommitChangesToActiveRecord).
This used to add the row to the grid and finish the step, now after we upgraded it is not working the way it was in v11.2. Nothing happens and it does not select the item in the first dropdown itself. Has anything changed between the versions?
Hi User,
A lot of things have changed between 11.2 and 14.2. In 14.2 especially, our Fields got a big overhaul and now we have different Field types such as TextField, ComboBoxField, DateTimeField, etc. Ideally you still shouldn't need to change anything but it's possible something happened between 11.2 and 14.2 which would require updating your code.
In my own tests where I used a ComboBoxField in order to populate a XamComboEditor, I was able to handle the SelectedItemChanged event and execute the following code:
var comboEditor = sender as XamComboEditor;comboEditor.EndEditMode(true, true);xamDataGrid1.ExecuteCommand(DataPresenterCommands.CommitChangesToActiveRecord);
Executing this code caused the clicked value in the XamComboEditor to force commit the new selection and the underlying data was updated as a result. You can see this in my attached sample.
Hi Rob.
Thank you for the sample, I tried it out and it works fine. Additional thing we have in our application is these events
- dataGrid1_RecordActivated- dataGrid1_RecordUpdating- dataGrid1_RecordUpdated
On selecting first XamComboeditor the event dataGrid1_RecordActivated gets fired and after selection the remaining two events are triggered. What I am noticing in my application is that these 2 events are not triggered and causing the issue. Any help/input on why this could happen?
Have you suppressed those events in the XamDataGrid? The datagrid has a SuppressedEvents collection where you can add events you don't want the grid firing. Other than that, the only way the RecordUpdating event would not fire is if the record's IsDataChanged property was false. But you are seeing the value change and get committed right? Your underlying data is actually changing?
As for the RecordUpdated event, this will not fire if the RecordUpdating event was canceled or if the commit failed. But if the commit failed then it wouldn't have changed your underlying data which doesn't appear to be the case.