This is a migrated thread and some comments may be shown as answers.

Error text issue

2 Answers 14 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 27 Jan 2011, 05:01 PM
Hello,

I did implement IDataErrorInfo and INotifyDataErrorInfo in order to validate the data in a RadGridView.

However, the error message is not displayed as expected.

If my error message is "ABCDEF"

It will be displayed like this:

ABCDEF
A
B
C
D
E
F


And if I click elsewhere in the grid, only the first letter of the message will be displayed (in this case, only the letter A).

Is the RadGridView supposed to handle IDataErrorInfo and INotifyDataErrorInfo or should I use the CellValidating event to set the error message?

2 Answers, 1 is accepted

Sort by
0
Accepted
Nedyalko Nikolov
Telerik team
answered on 01 Feb 2011, 04:19 PM
Hello Simon,

The problem comes from the fact that INotifyDataErrorInfo.GetErrors() method returns IEnumerable and because string is IEnumerable<Char> that's why the error message is shown that way. You could handle this in the following way:

public IEnumerable GetErrors(string propertyName)
{
  return new List<string>(){"ABCDEF"};
  //instead of
  //return "ABCDEF";
}

Let me know if this doesn't help.

Kind regards,
Nedyalko Nikolov
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Simon
Top achievements
Rank 1
answered on 11 Mar 2011, 05:14 PM
Sorry for the late answer but you were right about this... it solved my problem.

Thank you!
Tags
GridView
Asked by
Simon
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Simon
Top achievements
Rank 1
Share this question
or