Hi.
I am using the following code:
in combination with this xaml:
The second TextBox "Name 2" does show the DataErrors fine. However the GridViewDataColumn ("Name 1") seems unaware of the DataErrorInfos.
Am I missing something or is the GridVioewDataColumn unaware of IDataErrorInfo ?
Nils
I am using the following code:
public partial class Window1 |
{ |
public Window1() |
{ |
InitializeComponent(); |
this.Foos = new ObservableCollection<Foo>(new[] |
{ |
new Foo { Name = "1" }, |
new Foo { Name = "2" }, |
}); |
} |
private void Window_Loaded(object sender, RoutedEventArgs e) |
{ |
this.DataContext = this; |
} |
public ObservableCollection<Foo> Foos{ get; set;} |
} |
public class Foo : IDataErrorInfo |
{ |
public string this[string columnName] |
{ |
get |
{ |
return "Error"; |
} |
} |
public string Error |
{ |
get |
{ |
return "Error!"; |
} |
} |
public string Name { get; set; } |
} |
in combination with this xaml:
<Window x:Class="WpfApplication6.Window1" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" |
Title="Window1" Height="300" Width="300" |
Loaded="Window_Loaded"> |
<telerik:RadGridView ItemsSource="{Binding Path=Foos}" |
AutoGenerateColumns="False"> |
<telerik:RadGridView.Columns> |
<telerik:GridViewDataColumn Header="Name 1" |
DataMemberBinding="{Binding Path=Name, ValidatesOnDataErrors=True}" /> |
<telerik:GridViewColumn Header="Name 2"> |
<telerik:GridViewColumn.CellTemplate> |
<DataTemplate> |
<TextBox Text="{Binding Path=Name, ValidatesOnDataErrors=True}" /> |
</DataTemplate> |
</telerik:GridViewColumn.CellTemplate> |
</telerik:GridViewColumn> |
</telerik:RadGridView.Columns> |
</telerik:RadGridView> |
</Window> |
The second TextBox "Name 2" does show the DataErrors fine. However the GridViewDataColumn ("Name 1") seems unaware of the DataErrorInfos.
Am I missing something or is the GridVioewDataColumn unaware of IDataErrorInfo ?
Nils