Arg81
Well-known member
Just started out in ASP.net, all my previous work was in VB.net.
I may have got the wrong idea here, but hopefully someone can clear this up for me!!!
I know how to do a master-detail view. It shows the child rows based on the parent row selected.
HOWEVER......
How (in ASP.net) do I show related data??? I posted a thread about taking a parameter from a grid column but didn't really get an answer.
What I mean is that in my PARENT table, I have it's PK, but also 2 FK's related to 2 other tables.
Now, when the parent row is selected, I want 2 other grids to show the details of those 2 FKs.
I.E. I have a "XYZ". A XYZ is created by filling in some information and selecting BOTH a "Recipe" and a "Sieve".
Now the parent table (XYZ) will show this as (example) ;
XYZ_ID: 1
Description: Example
DateCreated: 03/05/07
CreatedBy: arg81
RecipeID: 10
SieveID: 7
So I can get a grid to show the above. I then want a grid to show the RecipeID details for RecipeID 1 and another grid to show the SieveID details for SieveID 7.
As the user browses through the XYZ rows, these 2 grids should change accordingly to the correct value shown in the XYZ grid.
Easy to do in a VB windows application but I'm completely lost in trying to do it in ASP.net !!! There are reasons I need to do it this way and can't do is as a windows application, otherwise I would of done to start with!!
If anyone can help, or at least point me in the correct direction I would be very grateful!!
Regards,
EDIT
Just had a thought, and I can obviously make a dataTable in the dataSet that contains all the rows I need to display, and then get this form to show one grid with everything in. (In fact I could probably split it across a few grids by using visible=False on certain columns in each grid). By doing this I would lose my UPDATE queries. I would still need to update the parent table (in case the wrong sieve was selected for example), so what would be the best way of getting around this?
I may have got the wrong idea here, but hopefully someone can clear this up for me!!!
I know how to do a master-detail view. It shows the child rows based on the parent row selected.
HOWEVER......
How (in ASP.net) do I show related data??? I posted a thread about taking a parameter from a grid column but didn't really get an answer.
What I mean is that in my PARENT table, I have it's PK, but also 2 FK's related to 2 other tables.
Now, when the parent row is selected, I want 2 other grids to show the details of those 2 FKs.
I.E. I have a "XYZ". A XYZ is created by filling in some information and selecting BOTH a "Recipe" and a "Sieve".
Now the parent table (XYZ) will show this as (example) ;
XYZ_ID: 1
Description: Example
DateCreated: 03/05/07
CreatedBy: arg81
RecipeID: 10
SieveID: 7
So I can get a grid to show the above. I then want a grid to show the RecipeID details for RecipeID 1 and another grid to show the SieveID details for SieveID 7.
As the user browses through the XYZ rows, these 2 grids should change accordingly to the correct value shown in the XYZ grid.
Easy to do in a VB windows application but I'm completely lost in trying to do it in ASP.net !!! There are reasons I need to do it this way and can't do is as a windows application, otherwise I would of done to start with!!
If anyone can help, or at least point me in the correct direction I would be very grateful!!
Regards,
EDIT
Just had a thought, and I can obviously make a dataTable in the dataSet that contains all the rows I need to display, and then get this form to show one grid with everything in. (In fact I could probably split it across a few grids by using visible=False on certain columns in each grid). By doing this I would lose my UPDATE queries. I would still need to update the parent table (in case the wrong sieve was selected for example), so what would be the best way of getting around this?
Last edited: