GridViewDataColumn: IDataErrorInfo awareness

3 posts, 1 answers
  1. Nils
    Nils avatar
    46 posts
    Member since:
    Jul 2009

    Posted 05 Feb 2010 Link to this post

    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. Answer
    Nedyalko Nikolov
    Admin
    Nedyalko Nikolov avatar
    871 posts

    Posted 05 Feb 2010 Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Nils
    Nils avatar
    46 posts
    Member since:
    Jul 2009

    Posted 05 Feb 2010 Link to this post

    Thanks for the quick answer.
    Have you seen that GridViewComboboxColumn is also affected ?
    (And possibly more GridView...Columns)

    Nils
Back to Top