Hi Support
We implement IDataErrorInfo for our Data, when we enter invalid data in edit mode it shows red box but when we update it to old data it doesn't change and still shows invalid data and error message and let us pass the cell.
We don't use cell validation and we use MVVM pattern.
thanks in advance,
Mehri
public partial class DataDictionary : IDataErrorInfo
{
#region IDataErrorInfo Members
public string Error
{
get
{
return null;
}
}
public string this[string columnName]
{
get
{
if (columnName == "Name")
{
if (Name == null || Name == string.Empty)
return "Name cannot be null or empty";
}
else if (columnName == "Code")
{
if (Code == 0)
return "Code Cannot be zero";
}
return "";
}
}
#endregion
}
//****************
<telerik:RadGridView ItemsSource="{Binding AllDataDictionary}"
SelectedItem="{Binding SelectedDataDictionary}"
HorizontalAlignment="Left" Margin="3,28,0,47"
Name="radGrid" ShowGroupPanel="False" Width="Auto"
AutoGenerateColumns="False"
ShowInsertRow="True" CanUserDeleteRows="False"
IsSynchronizedWithCurrentItem="True"
RowHeight="25" Height="405" >
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="Code" Width="70" DataMemberBinding="{Binding Code}"
ValidatesOnDataErrors="Default" />
<telerik:GridViewDataColumn Header="Name" Width="*" DataMemberBinding="{Binding Name}"
ValidatesOnDataErrors="Default" />
</telerik:RadGridView.Columns>
</telerik:RadGridView>