SessionIDs ids = (SessionIDs)Session["IDs"];
BSDataContext ct = new BSDataContext();
var customers = from cust in ct.tblCustomers
where cust.AccountID == ids.accountID
join mem in ct.tblCustomerMemberships on cust.CustomerID equals mem.CustomerID
orderby drpFilter.SelectedValue descending
select new { cust.CustomerID, cust.Mobile, cust.BusinessPhone, cust.Code, cust.Email, cust.HomePhone, mem.Membership, Name = cust.FirstName + cust.LastName };
grdCustomer.DataSource = customers;
grdCustomer.DataBind();
Still sorting is not performing.
If I write cust.Code instead of drp.selectedvalue then sorting is done! Why?