jeanflo2302 wrote:
Normal questions that I seek as I select a questionnaire to see these issues. Thank you for your help, but you have no idea to bind the grid? correct these issues but how to bind the answers?
Could you explain how to retrieve the name of the relationship
You mean, the name of the field mapped onto the relationship, e.g. 'Orders' in Customer.Orders ?
I think the reason this isn't solved yet is because we think you mean A, help you with that, but you mean B and don't understand why we want to help with A.
So let's get back to what the problem really is, and go from there.
What I think you are trying to do is that when someone clicks open a card view, the related information is loaded, am I right in that? Adapter doesnt support lazy loading, so you have to fetch the data INTO the data already bound.
So say you have a list of customers bound to the grid and when I click open a customer row, the ORDERS of that customer have to be loaded and shown IN the grid as a set of rows below it, correct? (in your example, it is questions, and you click open a question and all answers have to be loaded, correct?)
What we suggested was to load all related data BEFORE you bind the customers to the grid, or in your case, the questions. So with a prefetch path on Questions, to fetch the additional answers, you bind questions to the grid and specify in the devexpress grid that you want to view 'related data' (that's a devexpress topic, please look it up in their manual).
If you want to fetch data on the fly so not BEFOREHAND, you should simply do:
- find the Question Entity instance of the current row
- fetch the Answers collection of that entity:
adapter.FetchEntityCollection(questionEntity.Answers, questionEntity.GetRelationInfoAnswers());
but beware: it has to be setup properly in the devexpress grid: show related info. This can be a cumbersome topic on its own, as I too found showing related data in a devexpress grid problematic. But I just wanted to let you know that the llblgen pro part of the puzzle you're facing has been answered above, at least I hope I now have given the last piece of it