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

GridViewDataColumn: IDataErrorInfo awareness

2 Answers 74 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Nils
Top achievements
Rank 1
Nils asked on 05 Feb 2010, 07:53 AM
Hi.
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{ getset;} 
    } 
 
    public class Foo : IDataErrorInfo 
    { 
        public string this[string columnName] 
        { 
            get 
            { 
                return "Error"
            } 
        } 
 
        public string Error 
        { 
            get 
            { 
                return "Error!"
            } 
        } 
 
        public string Name { getset; } 
    } 

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

2 Answers, 1 is accepted

Sort by
0
Accepted
Nedyalko Nikolov
Telerik team
answered on 05 Feb 2010, 03:28 PM
Hi Nils,

Thank you for pointing this out. I've updated your Telerik points accordingly.
This issue is already fixed and will be available with the today's latest internal build.
Please give it a try and let me know how it works.

Best wishes,
Nedyalko Nikolov
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Nils
Top achievements
Rank 1
answered on 05 Feb 2010, 03:39 PM
Thanks for the quick answer.
Have you seen that GridViewComboboxColumn is also affected ?
(And possibly more GridView...Columns)

Nils
Tags
GridView
Asked by
Nils
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Nils
Top achievements
Rank 1
Share this question
or