Won't Fix
Last Updated: 14 Sep 2020 12:15 by ADMIN
ADMIN
Stefan
Created on: 16 Aug 2018 15:30
Category: GridView
Type: Bug Report
1
GridView: When validating through IDataErrorInfo and an invalid row is scrolled out of the viewport and then scrolled back into it, its background is not updated when a valid input is entered

		
8 comments
ADMIN
Ivan Petrov
Posted on: 14 Sep 2020 12:04

Hello all,

The behavior of RadGridView is correct in this case. You can read a further clarification below.

RadGridView has row-level and cell-level validation mechanisms. In the case of IDataErrorInfo validation, these are corresponding to the Error and string indexer properties of the interface. These are two separate entities meant for different purposes. You can have valid cell values but the combination of these cell values may result in an invalid row data. Here's an example: two cells, representing a percentage of the same entity, that have each a value of 60%. Individually they have valid values (0-100%) but the sum of 120% is not valid for the row (entity). When either of the properties in the IDataErrorInfo has values it will be displayed in the grid UI. The developer is responsible for the management of the error state for both cell(s) and row in the corresponding ViewModel.

Now on the specific case cited here. This is exempt from the IDataErrorInfo implementation in the ViewModel:

 

public string Error
{
    get
    {
        StringBuilder sbError = new StringBuilder();

        foreach (var error in ERRORS)
        {
            sbError.Append(error.Value + Environment.NewLine);
        }

        return sbError.ToString();
    }
}

public string this[string columnName]
{
    get
    {
        StringBuilder sbError = new StringBuilder();

        if (columnName == "StartDate")
        {
            if (this.StartDate == this.GeneralModelObj.ActualStartDate)
            {
                sbError.Append(this.StartDate + " should not be equal to ActualStartDate on header!");
                AddError("StartDate", this.StartDate + " should not be equal to ActualStartDate on header!");
            }
            else
            {
                RemoveError("StartDate");
            }
        }

        if (columnName == "EndDate")
        {
            if (this.EndDate == this.GeneralModelObj.ActualEndDate)
            {
                sbError.Append(this.EndDate + " should not be equal to ActualEndDate on header!");
                AddError("EndDate", this.EndDate + " should not be equal to ActualEndDate on header!");
            }
            else
            {
                RemoveError("EndDate");
            }
        }

        return sbError.ToString();
    }
}

 

Note that the AddError method adds a record in the ERRORS dictionary. We can observe here that the cell validation is performed whenever the getter of the indexer is accessed, while the Error property returns whatever the cell validation recorded previously without validating it. The potential for incorrect behavior is when cell values are edited or validation criteria is changed while the row is not in the viewport of the grid. In this case, the next time validation is performed the Error property will return errors until cell validation is performed anew.

To handle this case, row validation should be performed on request as cell validation is performed or errors (the ERRORS dictionary) should be updated when the validation criteria change. 

Regards,
Ivan Petrov
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

ADMIN
Yoan
Posted on: 02 Dec 2019 09:41

Hi Rashmi,

The issue comes from the fact that in some situations we are respecting both - the Error property the IDataErrorInfo interface and its indexer at the same time. This is why I have opened again this bug report. I've also increased its priority so that it could be considered for fixing as soon as possible. I can suggest avoiding the Error property as a temporary workaround.

We will try to find a solution that will fix this issue, the one with the duplicate errors and the following one - When validating through IDataErrorInfo the tooltip errors are updated only after trying to commit a row edit.

Please excuse us for any inconvenience caused.

Regards,
Yoan
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
ADMIN
Dilyan Traykov
Posted on: 29 Nov 2019 11:36

Hi Rashmi,

Thank you for the provided image, code snippet, and detailed action steps.

I can confirm that I was able to replicate it at my end but we will require a little more time in order to further investigate. We will update you with our findings as soon as possible, hopefully at the beginning of next week.

Thank you in advance for your patience and understanding.

Regards,
Dilyan Traykov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Rashmi
Posted on: 25 Nov 2019 04:26

Hi Vera,

To reproduce the issue you need to first modify the code (in the sample that you attached) in DataModel.cs class for Error property as:

public string Error

        {

            get

         {

                StringBuilder sbError = new StringBuilder();

                foreach (var error in ERRORS)

                {

                    sbError.Append(error.Value + Environment.NewLine);

                }

                return sbError.ToString();

                //return null;

            }

        }

This is because Telerik support team suggested to return null from Error property of IDataErrorInfo as temporary fix to avoid getting multiple errors on tooltip.

You can follow below steps to reproduce the issue once above code change is done:

  • Set ActualStartDate and ActualEndDate from header equal to any row's StartDate and EndDate respectively (Refer attached image).
  • Check the error tooltip icon for errors. The errors are displayed correctly, one for each error. 
  • Scroll down the grid to bottom and then scroll up again.
  • Now check error tooltip icon for error messages. There will be multiple entries of errors now. 

Please let us know in case you need any other assistance. 

Reagrds,

Rashmi Singh 

Attached Files:
ADMIN
Vera
Posted on: 22 Nov 2019 15:23

Hello Rashmi,

I tried to reproduce the problem with the item scrolled out and in the viewport with the project from our internal system but to no avail. I attached the project so you can test it on your side. Please let me know in case I am missing something and the issue can be reproduced on it.

 

Regards,
Vera
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Attached Files:
Rashmi
Posted on: 20 Nov 2019 10:51

We tested this issue on 'Telerik UI for WPF latest version 2019.3.1023.45' and found that this issue is still not fixed.

Please let us know the expected resolution time for this issue. 

ADMIN
Vera
Posted on: 11 Oct 2018 12:11
The fix for both issues will be available with 2018 R3 SP expected in the middle of October.
Rashmi
Posted on: 17 Aug 2018 04:04
Added one more issue which is observed without scrolling the grid out of the view port.
This scenario is when we have more than one errors in a row then on correcting error for one of them does not remove the error message from the error tooltip for the corrected one.
Below is the link to the ticket where we have mentioned the details:

https://urldefense.proofpoint.com/v2/url?u=https-3A__www.telerik.com_account_support-2Dtickets_view-2Dticket-3Fthreadid-3D1179102&d=DwMGaQ&c=PskvixtEUDK7wuWU-tIg6oKuGYBRbrMXk2FZvF0UfTo&r=PZHQDyTf39M33lREM6GcpOwCDl1nabSqbe_WIx-E6nE&m=YYHtGn-IJ-6FrcMR36j9UFuU1Sw23_utgR8t4j7KZYw&s=v-0uDSb8rNtySiNl3xBbr1nXwXb-2Xt2ouzg2u_Z1Ow&e=