Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Databinding entity with graph to asp.net repeater
 

Pages: 1
LLBLGen Pro Runtime Framework
Databinding entity with graph to asp.net repeater
Page:1/1 

  Print all messages in this thread  
Poster Message
MattWoberts
User



Location:
Lancaster, UK
Joined on:
08-Apr-2004 10:24:31
Posted:
497 posts
# Posted on: 27-Mar-2008 14:42:09.  
Hi,

I have an entity which I have fetched from the database, along with a lot of the related data which I specified by using a couple of prefetch paths. My graph looks like this

Checklist -> 1:N -> Questions -> 1:1 Question_Response

So my checklist entity has many questions, each of which have a single response. Data retrieval is fine Regular Smiley

So, I need to display all the questions in the asp.net page, along with the response. I have added a repeater and databound to the EntityCollection of Questions, but this only gives me access to the Question entities, like this:

<label>Question:</label>
<%# Eval("QuestionText") %>

What I then want to do is display the answer, but I don't know how to do this.. I need to tell the repeater to get it from the underlying Querstion's related answer, but I don't know an easy way to do this - all I can think of is to code it all manually in the OnItemDataBound like this ;-

{
myResponseLabel.Text = thisQuestion.Response.Answer;
.. and so on for other fields
}

Is this the only option I have, or is there a nice simple way to get this done ?

Thanks all!




Matt  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14618 posts
# Posted on: 27-Mar-2008 15:02:05.  
Code:
<%# DataBinder.Eval(Container.DataItem, "Response.Answer")%>

Related threads:
http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=10758
http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=12254


  Top
MattWoberts
User



Location:
Lancaster, UK
Joined on:
08-Apr-2004 10:24:31
Posted:
497 posts
# Posted on: 27-Mar-2008 15:05:50.  
Man, thats so obvious I didn't even try it!

Thanks!
Matt  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.