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

Binding to DataViewManager

5 Answers 73 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Staffan
Top achievements
Rank 1
Staffan asked on 12 Oct 2016, 09:41 AM

 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

5 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 17 Oct 2016, 09:11 AM
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.
0
Staffan
Top achievements
Rank 1
answered on 17 Oct 2016, 10:13 AM

 Hi,

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

/Staffan

0
Yoan
Telerik team
answered on 19 Oct 2016, 02:49 PM
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!
0
Jeffrey
Top achievements
Rank 1
answered on 16 May 2017, 12:35 AM

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?

0
Yoan
Telerik team
answered on 18 May 2017, 06:04 PM
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.
Tags
GridView
Asked by
Staffan
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Staffan
Top achievements
Rank 1
Jeffrey
Top achievements
Rank 1
Share this question
or