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

2 Grids - 1 DataSet with many-to-many relation

3 Answers 40 Views
GridView
This is a migrated thread and some comments may be shown as answers.
SomeName
Top achievements
Rank 1
SomeName asked on 25 Aug 2011, 10:29 AM
Hi.

I am currently facing a problem which isnt direclty related to telerik, but i still hope to get some advice.
I have found like hundreds of internet posts about building 1 grid with a related dataset, so that childs get displayed in the same grid.

But, i am currently trying to achieve the same stuff with 2 DataGrids with a DataSet that has a many-to-many relation.
So in thirst Grid i want to have my "Parent Elements", when i select a specific row i get in my second grid all the related elements of the selected grid.

There is the first Problem because i only found the GetChildRows method of the DataRow and this will give me the "Middle Table" (so the Table that makes a many-to-many Relation possible). What i am currently making is stepping threw those ChildRows and fetching the acutal Rows of the Third Table. I dont really believe thats the way it should be done, so please tell me how to get the actual related stuff.

Second is there a way to automatically insert/update the "Middle Table", my adapters do have the commands attached to it. But since i am losing the stuff in my first step, the object relation is gone. I am currently force to update it manually.

So hope you guys can help me out.

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 30 Aug 2011, 12:41 PM
Hello, 

Thank you for writing.

RadGridView does not support the scenario that you are looking for. The closest thing that you can get is the one that you have already achieved - to get the currently selected ParentRow, its child rows, and fetch the needed data from the ChildTable. However, this approach will not update the values of your tables and this should be handled manually - when a row is added, create the needed relations; when deleted remove the relations, when updated, find and update the necessary values. 

I hope that you find this information helpful. Should you have any other questions, do not hesitate to contact us.
 
Greetings,
Stefan
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
SomeName
Top achievements
Rank 1
answered on 07 Sep 2011, 10:48 AM
Sad to read this, hope this will be a feature in the future. Especially with others controls.

Maybe a detailed explanation of what i am trying to achieve helps to give some ideas for implementing this feature.
So my form is splitted into 3 main controls.

1st is a treeview that holds the main data (parent Elements you could say), with custom nodes i am already showing the important stuff of the child grids, so for example the child with the highest priority or where the valid date is passed or many other possibilities. (An overview for the important stuff)
This TreeView has to be updated with the newest information everytime the user edits data in the child grid.

2nd control is a page view that holds the grid for the child stuff, in the header again you can find useful information about childs/parent.

3rd controls are the grids them self they hold the child information of the selected treeview element. With detailed information edit and so on.

So in the future it would be nice instead of getting child/parent stuff manually to have it do it automatically, since a many-to-many relation should be always the same it could be possible to make this automatically.

Maybe in some weeks/months/years (hopefully not decades) i can see this feature. :)
0
Stefan
Telerik team
answered on 12 Sep 2011, 01:29 PM
Hello,

Thank you for this detailed explanation of your scenario. It is a specific case, however it makes sense and I will speak with our developers regarding it. Please, could you send us your application. This will allow us to find points where to optimize our controls. We will appreciate that.

If you have other questions, do not hesitate to write back.

Greetings,
Stefan
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
GridView
Asked by
SomeName
Top achievements
Rank 1
Answers by
Stefan
Telerik team
SomeName
Top achievements
Rank 1
Share this question
or