Last post Oct 18, 2013 05:09 AM by sjnaughton
Sep 25, 2013 02:22 AM|mr41971|LINK
The List displays the Foreign Key (e.g. 1) and the Details displays the values (e.g. Active). Why? What am I missing? Is it something in the List.aspx? Please help before I am admitted to the ASSYLUM.
Sep 25, 2013 02:28 AM|asyed4u|LINK
u can alter the display columns for the [ foreign key ]
Sep 25, 2013 02:41 AM|MetalAsp.Net|LINK
Can you clarify your question? I, for one, have no idea what you're talking about or asking.
Sep 25, 2013 03:18 AM|mr41971|LINK
This is a Dynamic Data project. I have an entity called Student, it has an attribute called StatusID which references a table called StudentStatus. In the List.aspx page the Status field shows the Foreign Key identity column. In the Details.aspx file The
Status field shows the value for the Status Column:
I would like to have the value for the Status column displayed in the List.aspx page as well. I hope this clears things up.
Sep 25, 2013 06:34 AM|sjnaughton|LINK
Hi mr41971, this should work out of the box, have you tried creating a sample DD site based on Northwind or Adventure works to see this working?
Sep 25, 2013 06:51 AM|mdsajidfaizan|LINK
To call the table values, you are definately bibding the table with the controls.
You just need to add this code while binding the data,
For example if the control you are using is Dropdown
Sep 25, 2013 07:05 AM|mr41971|LINK
Steve I did a small DD project with just the Student table and the StudentStatus table and it worked perfectly which suggests to me that some piece of code is missing from my project somewhere, I however don't have a clue. I even tried to copy from the small
DD project to my larger project into the Model.Designer.cs file with no success. I suspect I have to do a closer inspection of this file.
Sep 25, 2013 08:38 AM|sjnaughton|LINK
Did you add DD to you Web Forms Dynamic Data project of sis you start from the Dynamic Data project template?
Sep 25, 2013 11:32 AM|mr41971|LINK
I started the project from scratch as a DD project. I made modification to the DomainService.cs file by adding Data Annotations and I also added some functions to allow me to present the data as the users wanted to see it. For example:
[RequiresRole("Clerk", "Teacher", "Principal", "Parent")]
public IQueryable<Student> GetStudents()
List<int> intListofStudentIDs = new List<int>();
intListofStudentIDs = getStudentIDsByParent(getParentID());
return this.ObjectContext.Students.Where(s => intListofStudentIDs.Any(i => i == s.ID)).OrderBy(s => s.ID);
return this.ObjectContext.Students.OrderBy(s => s.ID);
Notice the getStudentIDsByParent() function. I am logging in as Clerk which is the only role that can see or edit the Status field.
Sep 25, 2013 12:26 PM|mr41971|LINK
One thing I forgot to mention was that I added the StudentStatus table and the StatusID field in the Student table a few months after working on my project. I updated the model from the database and hoped that would integrate my addition neatly into my project.
Oct 18, 2013 05:09 AM|sjnaughton|LINK
Then it looks to me that there is somthing wrong in your:
Not sure what the issue could be, I have to update my data models regularly with changes etc and never have any issues but then I don't use Domain Service you may need to recreate you Domain Service and then add your modification to the new DS.