How to access a grandparent of a table in dynamic data?


It is a common case to show the parent data, by foreignkey, in dynamic data. But I get stuck when I try to access the parent of a parent table, i.e. the grandparent of a table.

I have a table called "Bill" which has the foreignkey to table "Application". And Table "Application" has foreignkeys to table "Course" and table "Student". Now, I am trying to get the column "Title" of table "Course" and column "Name" of table "Student", as the foreignkey display of "Application". In other words, I want to get the data from Bill to Course and Student by using Application's foreignkey.

 Could anyone know how to do so, preferably by using metadata and custom FieldTemplate?

1/30/2009 9:37:21 AM 1365 articles. 0 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 45

First of all could you give a litle more detail (please read this blog post) i.e. is this a Many to Many relationship




if it's not a Many to Many the you could create a custom ForeignKey FieldTemplate for this relationship.

Steve Big Smile

Seeking the elegant solution.
[Oh! If olny I colud tpye!]
c# Bits blog
Oh, and don't forget to mark as answer any posts that help you Big Smile
1/30/2009 11:22:35 AM

I am using dynamic data along with Entity Framework. The version of my dynamic data is NET Framework 3.5 SP1.

It isn't a Many to Many relationship

Bill * -> 1 Application 1 -> 1 Course
                                1 -> 1 Student

I have tried to implement the custom Foreignkey FieldTemplate, but get stuck when try to access the grandparent by metatable or getting the entity data as a Row. Can you show me how to access the grandparent? Also, I struggled with building the navigaional url too!




1/30/2009 12:32:24 PM

Similar Artilces:

Dynamic table generation by JavaScript, Accessing row and data of dynamic table in C# code
  <div>   <input id="txtName" type="text"/> <input id="txtAdd" type="text"/> <input id="txtCity" type="text"/>   <input id="btnAdd" type="button" value="Add" onclick="AddClick();" /> <input id="btnRemove" type="button" value="Remove" onclick="RemoveClick(this);"/><br /> <table id="tblInfo" runat="server" style="width: 474px" > </table> </div&g...

Showing data in a dynamic table with the help of a dynamic table
   Hi Friends,I've a DataReader which fetches records.I'm able to show the records in a gridview but my problem is how to show the records in a  dynamic table?  I was doing it in following way...........   Sub gvBind(ByVal ToDate As Date, ByVal FromDate As Date)MyConn = New SqlConnection(System.Configuration.ConfigurationManager.AppSettings(strConn))  MySqlCom = New SqlCommand("ADMsp_Fetch_DailySales", MyConn) MySqlCom.CommandType = CommandType.StoredProcedure MySqlCom.CommandTimeout = 1000MySqlCom.Parameters.Add("@todate", S...

Add Table Row containing TextBoxes dynamically + Access data from dynamically added TextBoxes
Let's say I have a table, each row containing 5 cells, each cell containing a TextBoxBy default, I want only 1 row showing... but I want to have a Button that allows me to add an additional row every time it's clickedHow do I dynamically add TableRows containing TextBoxes in VB? Or is this something that should be done client-side with Javascript?I also want to be able to use the user's input from these TextBoxes in the body of an email that will be sent through the web page when the user clicks a "Submit" button on the page.I'm new to VBScript so I'm really loo...

A custom data access layer with dynamic data.
Hi, The dynamic data web application by default operates on connected enviornment, but I want to use dynamic data in a disconnected environment, where  I have my own data access layer with the relavent methods exposed, in a senario as such how can i connected with dynamic data? What are the changes i need to make when registering the control and in the LinqDataSource?   Thank you Dilrukshi The release version only supports Linq to SQL and DynamicData but the Preview uses the DomainService also and with this you can use your own Data Access layer. see here for PreviewSteve ...

Querying a Table By a Data Key in Dynamic Data
Check out this post:  It describes how to query a child table using a column from a parent table.  The parent table contains the data key that is the foreign key in the child table. This posting is provided "AS IS" with no warranties, and confers no rights.I blog at: Technical Notes See also this series that also covers similar The Anatomy of a FieldTemplate. Your First FieldTemplate. An Advanced FieldTemplate. A Second Advanced FieldTemplate. An ...

Dynamic Data And Ado.Net Data Service
Hi,I'm wondering if it is possible to mix up Dynamic Data and Ado.Net Data Service.I have found no information on google yet.Thanks for your replies, Hasan Yes you will be able to have a look at the Preview on Codeplext here the new Domain Service will allow this sort of thing see David Ebbo's and Nukhil Kothari's sessions at mix09 Microsoft ASP.NET 4.0 Data Access: Patterns for Success with Web Forms .NET RIA Services - Building Data-Driven Applications with Microsoft Silverlight and Microsoft ASP.NETSteve Seeking the elegant solution.[Oh! If olny I colud tpye!]c# Bits...

Dynamic Data over ADO.NET Data Service
I would like to create a dynamic data web site that does not have a database connection to the underlying database, but instead accesses the data through an ADO.NET data service.  Is this possible?  Thanks,Dennis If you look at the Dynamic Data Futures solution on CodePlex, it has an early version of something that does that.  Also, see this thread. thanks,David David,  That's exactly what I was looking for.  However, I am running into a problem when I try to develop my own dynamic data client site.  I created a dynamic data web site, added a referenc...

Dynamic Data with ADO.NET Data Services
Is it currently possible to use Dynamic Data with ADO.NET Data Services? I've had a play with this to see if this would work but I didnt have much luck. I ran the datasvcutil.exe against my service (which is a  ADO.NET Data Services on a LINQ to SQL model) but I ended up with a "The context type 'Entities.NorthwindDataContext' is not supported" message.  It seems to make sense that these technologies would work there something else I am missing? Perhaps this functionality isn't supported yet? Thanks, Craig Hi Cr...

Dynamic Data WebSites Vs Dynamic Data Entities WebSite
Can anyone list some of basic differences between Dynamic Data WebSite and Dynamic Data Entities WebSite? When would you choose one over the other? Dynamic Data WebSites  requires a Linq to SQL data model. Dynamic Data Entities requires an ADO.Net Entity Framework data model.Rick -ASP.Net UE  My DD Blog  DD FAQ...

Preview Release of Dynamic Data and Dynamic Data Website Wizard Available
Today we are releasing public updates to Dynamic Data and some new tooling support called the "Dynamic Data Website Wizard". These new releases are available for anyone to download the code gallery site at: Through this new site we will be able to release more frequent updates of these features. We would like to continue to have feedback on these new features via this forum. Here is a direct link to the download: One of the very cool new features is th...

Missing Dynamic Data Website and Dynamic Data Web Application templates
 I have installed VS 2008 SP1 and .Net 3.5 SP1 but I still don't see the Dynamic Data Website and Dynamic Data Web Application templates when I try to create a new website or web application. Hi, when you choose to add a new project make sure that the targeted framework is indeed 3.5 and that you select the C# or VB.NET root node or in the Web node. Normally they should be in there. When I installed it on one of my laptops I didn't see them either. I didn't check the 3.5 framework and apparently it stood on 3.0 causing me to go like  until I found it. ...

Dynamic Data with ADO.NET Data Services #2
I'm using the DynamicData Futures Preview 2 DLL's to create an n-tier Dynamic Data website using ADO.Net Data Services.I'm trying to add Many-to-Many relationship support using David Ebbo's article as a basis, but it would appear that the client-side model generated by DataSvcUtil.exe (Add Service Reference....) doesn't contain enough information to identify Many-to-Many relationships?For example, I have Contacts and Regions joined through a ContactRegion table.  EF models this correctly on the server and DataServices exposes it correctly - With a Contact having a Re...

Dynamic Data working against an ADO.NET Data Service
 Is there an example available of Dynamic Data using an ADO.NET Data Service?  I read there are prototypes of this in the works, are they available for review / use?  Check out our Dynamic Data Futures for a prototype data source control for consuming ADO.NET Data Services. HunterPM, ASP.NET Team, Microsoft...

Adding ColumnOrder in my Metadata from Dynamic Data Futures to my existing Dynamic Data website
Hi,I currently have a dynamic data website (I did not use the dynamic data wizard) and would like to order my columns in my metadata file that I created.  When I put [ColumnOrder(x)] above one of my fields ie. public object Product { get; set; }  I get these errors: The type or namespace name 'ColumnOrder' could not be found (are you missing a using directive or an assembly reference?)  and  The type or namespace name 'ColumnOrderAttribute' could not be found (are you missing a using directive or an assembly reference?)  The  ...

Web resources about - How to access a grandparent of a table in dynamic data? -

Grandparent - Wikipedia, the free encyclopedia
Grandparents are the parents of a person's own parent, whether that be a father or a mother – paternal or maternal . Every sexually-reproducing ...

Grandparents prove Facebook is no longer just for the young
People say that Facebook is for kids, but one of the fastest growing categories is grandparents — folks older than 50. Click below to find out ...

25989 Happy Grandparent Great Smile - Flickr - Photo Sharing!
When I got to church for praise team practice Wednesday night the birth rosebud from Sunday was still there. I had attempted to catch grandfather ...

Grandparents Trying Out New Things - YouTube
In today's world of hustle and bustle, it can be hard for grandparents to keep up. Between cell phones, fancy cars and other advancements in ...

Video captures touching surprise for Irish grandparents
It was a touching video that would strike a chord with the families of any ex-pat separated from the ones they love.

Why you should teach your grandparents how to use Facebook
While teaching your grandparents – or your parents, for that matter - to use the internet can be frustrating, a new study suggests it could be ...

Super Junior singer Lee Teuk's father, grandparents found dead in South Korea
THE father and grandparents of a member of South Korean boy band Super Junior have died in a suspected murder-suicide.

William Tyrrell investigation turns to grandparent support groups
Detectives investigating the disappearance of William Tyrrell have examined two grandparent support groups, one of whose former members included ...

Prime Minister pledges action on murdered Queensland toddler: grandparents
The grandparents of a murdered Queensland toddler say Prime Minister Tony Abbott has written to them promising a high-level meeting so they can ...

Toddler stable after found in grandparents' pool
A two-year-old girl is being treated at Ipswich Hospital after being found in a pool at her grandparents' house at Yamanto, west of Brisbane, ...

Resources last updated: 12/3/2015 7:34:32 PM