Why won't this sequence of entities sort in the GridView after binding?

Voice

New Member
This sequence I created works well in LINQPad\[code\]IQueryable<AccessRequest> filteredRows1;// retrieve the last record of each request in its request historyfilteredRows1 = from req in AccessRequestSet group req by req.TaskReferenceId into g let topReq = g.OrderByDescending(r => r.UpdateDate).FirstOrDefault() select topReq;IQueryable<AccessRequest> filteredRows = filteredRows1.Where(o => o.Status == "Requested");\[/code\]I want to then sort these entities by the field, RequestedReleaseTime.\[code\]filteredRows.OrderBy(p => p.RequestedReleaseTime);\[/code\]Again I'm grouping by one DateTime successfully, and then sorting by another DateTime successfully, confirmed in LINQPad. I then add this as a DataSource and bind to my GridView:\[code\]gvRequests.DataSourceID = string.Empty; gvRequests.DataSource = filteredRows; gvRequests.DataBind();\[/code\]I have even set AllowSorting="true" and added this line to Sort. \[code\]gvRequests.Sort("RequestedReleaseTime", SortDirection.Ascending);\[/code\]I have tried this last line before and after the DataBind to no avail. What is wrong with this approach? Should I be doing any of this within the OnSorted or OnSorting events? Note: I tried that and got StackOverflowException, which reminded me that I should be asking you guys. Thanks millions for any direction or help I receive.
 
Back
Top