I am using the grid control and having a problem where it is not sorting on a column that is being calculated. Here's the relevant part of my controller, where I'm performing my LINQ query:
select new Models.ApplicationModels.CustomerModel
{
CustomerID = instance.CustomerID,
CustomerOrders = GetCustomerOrders(instance.CustomerID)
};
This all displays perfectly fine. I can sort on CustomerID, but I can't sort on CustomerOrders. I'm not doing anything special with the binding, just calling it the same way as CustomerID.
How can I get this to sort properly? Would it help if I moved the logic of GetCustomerOrders into a SQL function and made it a computed column there? I should note that I'd like to be able to sort this across all Customer entities -- and I am looking at a lot of data (millions of rows). If there is a better way of handling this I'm open to suggestions.
select new Models.ApplicationModels.CustomerModel
{
CustomerID = instance.CustomerID,
CustomerOrders = GetCustomerOrders(instance.CustomerID)
};
This all displays perfectly fine. I can sort on CustomerID, but I can't sort on CustomerOrders. I'm not doing anything special with the binding, just calling it the same way as CustomerID.
How can I get this to sort properly? Would it help if I moved the logic of GetCustomerOrders into a SQL function and made it a computed column there? I should note that I'd like to be able to sort this across all Customer entities -- and I am looking at a lot of data (millions of rows). If there is a better way of handling this I'm open to suggestions.