Hi,
I have found two problems in dxDataGrid, probably close related to each other thus I report both of them here in one ticket.
Please check out the sample on https://codepen.io/anon/pen/PeYZVr and perform the following:
- scroll down e.g. to the middle of grid content (note the grid is working in virtual mode)
- click in any 'First name' cell, make some changes
- click on the cell in one row below -> red message appears (its fine, the custom validation routine rejects any changes)
- click on the cell in one row below again -> second red message appears (!) See https://snag.gy/INrl91.jpg
Note this behavior does not occur in the upper part of the grid.
Second problem is related:
- scroll down to the middle of grid content
- activate some cell, make a change by typing 'dummy' in the cell
- try to focus next row, changes are rejected by validation, red message is shown (so far OK)
- without undoing the changes (red message still visible) scroll the grid content up and down, making the red message disappear of screen; at some point the alert pops up (from calculateCellValue) indicating that calculateCellValue was called for the rejected value
In my opinion this is not a valid behavior that value rejected by validation has been saved in the underlaying field.
greetings
Bartek
My reference: DF033938
Hello Bartek,
Thank you for your report and sample. I have reproduced both behaviors. Let me start from the second one.
An invalid value is not passed to the original data source. You can handle the onRowUpdated event to see this. At the same time, the calculateCellValue event handler is designed to show intermediate merged data, thus, the alert is shown. If you need to get the source row in this event handler, I suggest that you fetch it by a key field from the data source directly.
As for the first behavior, it looks incorrect to me and I have passed this thread to our developers for further research. Once we have any news, we will update this thread. If you have any further questions about the provided information, feel free to reactivate this thread.
Hi Maxim,
regarding the second problem, I would disagree with you. I would assume (basing on documentation) that calculateCellValue is called in order to convert a value stored in datasource to a value visible/editable in the cell.
Let's imagine a situation my field in the datasource is a number but I present/edit it as string, making proper conversions. The int-to-string conversion would be performed in calculateCellValue and I see no reason why calculateCellValue should be called for the modified, invalid (not validated) string value.
greetings
Bartek
Hello,
I've created a separate ticket on your behalf (T627175: DataGrid - The calculateCellValue event is raised with the merged data row). It has been placed in our processing queue and will be answered shortly.