Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2732
Performance issue with WinGrid & EditorWithCombo & IDataErrorInfo
posted

Hello,

I'm trying to implement row/cell errors using IDataErrorInfo and I'm encountering some performance issues.
The performance problem occurs on a column containing an EditorWithCombo with DropDownValidate style.
I've set the column to be required (UltraGrid1OnBeforeExitEditMode event), and when I empty the value of the combobox (= select no value) it takes a really long time before the error is displayed. This compared to the string column which works immediately.

In attachment you will find an example solution. The CompanyEntity.CountryID property is displayed as a dropdown containing the specific countries.
I expect the problem occurs because the country name (string) is attempted to be put in the CountryID field (integer). 

You can reproduce the problem by starting the application, emptying one of the row's countryID column and then clicking on another row.

Any help on how to avoid this problem would be appreciated.

Kind regards,

Michael

PS: Version 12.1.2054

WindowsFormsApplication6.zip
Parents
  • 469350
    Offline posted

    Hi Michael,

    What's happening here is that the editor in the cell is converting DisplayText into DataValue. In this case, it's failing to do so, because there is no empty string on the list. So it's using an empty string as the Value of the cell and a whole bunch of exceptions end up getting raised. the exceptions are caught, but they cause causes a big performance hit.

    If you are going to let the user blank out the cell, then you could alleviate the performance hit by adding a blank item to the list so that it matches up an empty string with a null (or DBNull.Value).

Reply Children