Binding to DataViewManager

6 posts, 0 answers
  1. Staffan
    Staffan avatar
    2 posts
    Member since:
    Feb 2016

    Posted 12 Oct 2016 Link to this post

     Hi,

    I read in this, http://www.telerik.com/forums/details-of-features-supporterd, thread that you fully support binding to DataViewManager. However, I can't get it to work. Can you please elaborate on how it's possible to bind the grid to DataViewManager to be able to display the hierarchy of the tables in the underlying dataset.

    The background/purpose of my question is this: I have a DataSet returned from our service that contains multiple tables with a parent-child relation, specified with a DataRelation in the DataSet. These tables are fully dynamic which makes it hard to create a proper ViewModel of it. Hence, I want to display the data with its relation directly in the grid.

    This works well when binding the grid directly to the DataSet. The hierarchy is correctly displayed in the grid. However, my next demand is that it should support update notification of the underlying data so that the grid automatically refreshes when a value in a DataTable changes. That's why I figured I should bind to the DataViewManager of the DataSet instead, but that doesn't work. Binding to the parent table's DataView works, but then the hierarchy is lost (and I get a DataRelation column too).

    /Staffan

  2. Yoan
    Admin
    Yoan avatar
    1111 posts

    Posted 17 Oct 2016 Link to this post

    Hello Staffan,

    I am sending  you a sample project which demonstrates how to use DataViewManager and our RadGridView. Please note that if the DataViewManager contains two or more tables, you must specify the table to bind to.

    I hope this helps.

    Regards,
    Yoan
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. Staffan
    Staffan avatar
    2 posts
    Member since:
    Feb 2016

    Posted 17 Oct 2016 in reply to Yoan Link to this post

     Hi,

    Your sample doesn't show any hierarchy/relation in a single grid at all, so it isn't useful.

    /Staffan

  4. Yoan
    Admin
    Yoan avatar
    1111 posts

    Posted 19 Oct 2016 Link to this post

    Hello,

    You can use GridView's RowDetails feature as demonstrated in this help article. Please check the updated version of my sample project.

    Regards,
    Yoan
    Telerik by Progress
    Do you need help with upgrading your WPF project? Try the Telerik API Analyzer and share your thoughts!
  5. Jeffrey
    Jeffrey avatar
    2 posts
    Member since:
    Nov 2015

    Posted 15 May in reply to Yoan Link to this post

    With the example posted Oct 19 2016; I see the drill down working.  However, when the relations between TableA and TableB are created, the drill down will not auto filter the data to the records only applicable to the parent record.

     

    How can this be performed so that when the user clicks the row, the child records are automatically filtered based on the relationship between tableA and TableB?

  6. Yoan
    Admin
    Yoan avatar
    1111 posts

    Posted 18 May Link to this post

    Hello Jeffrey,

    I'm sending you a sample project, which demonstrates how to fill the child grid in the LoadingRowDetails event.

    I hope it helps.

    Regards,
    Yoan
    Telerik by Progress
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top