GridView columns not updating as DataTable columns update

2 posts, 0 answers
  1. Jeremy
    Jeremy avatar
    1 posts
    Member since:
    Apr 2013

    Posted 18 Apr 2013 Link to this post

    I have a RadGridView which has its ItemsSource property bound to the the DefaultView of a DataTable that is created and updated by a ViewModel.  The GridView has the AutoGenerateColumns property set to true.

    When columns are added to this DataTable and the PropertyChanged event is fired, the new columns are not added to the GridView.

    Also, when columns are removed from the DataTable and the PropertyChanged event is fired, the data from these columns is removed from the GridView, but not the columns themselves.

    Does the AutoGenerateColumns property only generate columns when the control is initialized?  Does this behavior of dynamically removing and adding columns as the underlying DataTable is changed not exist?
  2. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 19 Apr 2013 Link to this post

    Hello,

    In short - YES , columns are auto generated initially  and later changes in the columns of source table should be handled by custom code. There is no functionality built in RadGridView to keep watch on changes in columns in a data table.

    Regards,
    Pavel Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top