Bug Report T626571
Visible to All Users

A validation message is shown many times if DataGrid works in virtual mode

created 7 years ago (modified 7 years ago)

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

Comments (3)
DevExpress Support Team 7 years ago

    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

      DevExpress Support Team 7 years ago

        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.

        Answers approved by DevExpress Support

        created 7 years ago

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.