3 Answers, 1 is accepted
0
Hi David,
Andrew
the Telerik team
We could not reproduce your issue. We use a RadRichTextBox bound to a property in the ViewModel and everything seems to work fine.
We attached a demo project illustrating our approach.
If you can't make it work please send us a demo with your problem. If you meet other difficulties contacts us again.
Andrew
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
David
Top achievements
Rank 1
answered on 17 Jun 2011, 12:47 PM
Thanks for the response.
I amended your version of your solution to demonstrate the issue I am having.
You will see that when the page is loaded the regular textbox shows it is in error yet the radrichtextbox does not, even though IDataErrorInfo is returning an error message to the control.
Thanks
ViewModel
View
I amended your version of your solution to demonstrate the issue I am having.
You will see that when the page is loaded the regular textbox shows it is in error yet the radrichtextbox does not, even though IDataErrorInfo is returning an error message to the control.
Thanks
ViewModel
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
namespace SilverlightApplication37
{
public class ViewModel : IDataErrorInfo, INotifyPropertyChanged
{
public ViewModel()
{
this.text = string.Empty;
}
private string text;
public string Text
{
get
{
return this.text;
}
set
{
this.text = value;
this.OnPropertyChanged(this, new PropertyChangedEventArgs("Text"));
}
}
public string Error
{
get { return null; }
}
public string this[string propertyName]
{
get
{
switch (propertyName)
{
case "Text":
if (string.IsNullOrEmpty(Text)) return "Error";
break;
}
return null;
}
}
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(object sender, PropertyChangedEventArgs args)
{
if (this.PropertyChanged != null)
{
this.PropertyChanged(sender, args);
}
}
}
}
View
<
UserControl
x:Class
=
"SilverlightApplication37.MainPage"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:txt
=
"clr-namespace:Telerik.Windows.Documents.FormatProviders.Txt;assembly=Telerik.Windows.Documents"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"400"
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
>
<
txt:TxtDataProvider
Text
=
"{Binding Text, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}"
RichTextBox
=
"{Binding ElementName=radRichTextBox}"
/>
<
telerik:RadRichTextBox
x:Name
=
"radRichTextBox"
Height
=
"139"
IsSpellCheckingEnabled
=
"False"
Margin
=
"12,12,0,0"
VerticalAlignment
=
"Top"
HorizontalAlignment
=
"Left"
Width
=
"307"
>
</
telerik:RadRichTextBox
>
<
TextBox
Text
=
"{Binding Text, ValidatesOnDataErrors=True, NotifyOnValidationError=True, Mode=TwoWay}"
Height
=
"23"
HorizontalAlignment
=
"Left"
Margin
=
"12,172,0,0"
Name
=
"textBox1"
VerticalAlignment
=
"Top"
Width
=
"307"
/>
</
Grid
>
</
UserControl
>
0
Hello David,
Andrew
the Telerik team
Thank you for the report of this bug. Indeed there is a problem in the initial load of our control when using IDataErrorInfo.
We fixed it and you can see the change in our upcoming release in mid July.
We updated your Telerik points accordingly, in appreciation for your help.
If you have other concerns or suggestions, do not hesitate to get back to us.
Andrew
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items