From what I understand you want to order the columns/fields of an Entity.you only need to rename columns/fields in an Entity.
If you use Linq to Entity, I would suggest you to try the following workaround:
C#:
var query =
from contact in contacts
from order in orders
where contact.ContactID == order.Contact.ContactID
&& order.TotalDue < totalDue
select new
{
ContactID = contact.ContactID,
LastName = contact.LastName,
FirstName = contact.FirstName,
OrderID = order.SalesOrderID,
Total = order.TotalDue
};
VB:
Dim query = _
From contact In contacts _
From order In orders _
Where contact.ContactID = order.Contact.ContactID _
And order.TotalDue < totalDue _
Select New With _
{ _
.ContactID = contact.ContactID, _
.LastName = contact.LastName, _
.FirstName = contact.FirstName, _
.OrderID = order.SalesOrderID, _
.Total = order.TotalDue _
}
I hope it helps you.
We are trying to better understand customer views on social support experience. Click HERE to participate the survey. Thanks!
Not really Dynamic Data as it is is only in Web Forms at the moment there are some feature in MVC that are based on DD but the posts should be in the correct forum this is a Web Forms forum :)
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
Member
18 Points
187 Posts
How can I order the columns/fields of an Entity
Sep 23, 2013 03:13 AM|mr41971|LINK
I have an Entity in which one of the primitive columns is being displayed between the navigation columns. How can I fix this?
All-Star
15648 Points
2151 Posts
Re: How can I order the columns/fields of an Entity
Sep 24, 2013 05:22 AM|Happy Chen - MSFT|LINK
hi mr41971,
From what I understand you want to order the columns/fields of an Entity.you only need to rename columns/fields in an Entity.
If you use Linq to Entity, I would suggest you to try the following workaround:
I hope it helps you.
All-Star
17916 Points
5681 Posts
MVP
Re: How can I order the columns/fields of an Entity
Sep 24, 2013 06:47 AM|sjnaughton|LINK
I am assuming you are using Dynamic Data, if so you can use the Display attribute to set the Order.
[Display(Order = 0)]
add one to each property and the you will set the display order.
Always seeking an elegant solution.
Member
18 Points
187 Posts
Re: How can I order the columns/fields of an Entity
Sep 24, 2013 11:38 AM|mr41971|LINK
Thanks Steve.
Member
18 Points
187 Posts
Re: How can I order the columns/fields of an Entity
Sep 25, 2013 01:57 AM|mr41971|LINK
Are'nt all posts to this forum supposed to be related to dynamic data?
All-Star
17916 Points
5681 Posts
MVP
Re: How can I order the columns/fields of an Entity
Sep 25, 2013 06:46 AM|sjnaughton|LINK
No we get lots of MVC and SQL post here
Always seeking an elegant solution.
Member
18 Points
187 Posts
Re: How can I order the columns/fields of an Entity
Sep 25, 2013 07:10 AM|mr41971|LINK
Data Scaffolding using ASP.NET Dynamic Data
Does Data Scaffolding fall within those other area?
All-Star
17916 Points
5681 Posts
MVP
Re: How can I order the columns/fields of an Entity
Sep 25, 2013 08:37 AM|sjnaughton|LINK
Not really Dynamic Data as it is is only in Web Forms at the moment there are some feature in MVC that are based on DD but the posts should be in the correct forum this is a Web Forms forum :)
Always seeking an elegant solution.