Where do I post a question about DataView in an ASP.Net 2.0 web site? RRS feed

  • Question

  • I have been assigned to help debug a new web site. On one of the pages, they want to use GridView sorting. In the Sorting event, there is code to get a DataTable from the database, then sort it based on the e.SortExpression. The code to sort the data looks just like the example code I have seen in many places, but it is not working.

    The problem is, when I step through the code, I stop right after the dt.DefaultView.Sort and the data has not been sorted by the sort expression. I tried creating a DataView from the table and provided the sort expression, and when I stop right after the DataView has been created, the data is NOT sorted by the sort expression. I tried dv.Sort = e.SortExpression and when I stop the code right after the dv.Sort, the data is NOT sorted.

    I have copied the exact same code into a new web site with a single, simple page and it works just like in the examples, the DataTable is sorted, or if I try the DataView, it is sorted, but the same code will not work in the web site I have been assigned to debug.

    I am stumped. Can anyone help me with this one?
    Thursday, September 18, 2008 2:32 PM


All replies