I have a custom entity that I have created within my web application and I am binding it to my DataGrid (I know I should be using a GridView, but that change will come later...). Previously the data was being retrieved into a DataTable, so when I needed to sort, I could just apply a DataView to the DataTable passing the appropriate sort filter and I was set. But with the Generic list, it was not that simple. I did a little research on Delegates and Predicates to maybe solve my problem, but then I was creating custom code for each and every list that I needed to perform this on. However, in my Google searching I discovered this article, Sorting GridView Using IComparer by TheDotNetGuy and he is a using a GenericComparer class to do exactly what I wanted. I really liked the flexibility that this solution provided.
As an example, I could sort a list of personnel by last name as follows:
Monday, July 23, 2007
I ran across the following ASP.NET AJAX links over the last couple of weeks that I found interesting and useful, so I thought I would pass them along.
- Why ASP.NET AJAX UpdatePanels are dangerous - an article that warns of the overhead associated with using ASP.NET AJAX UpdatePanels to add "instant" AJAX capability to your website. Describes the use of JSON and PageMethods as a better performing alternative.
- How to improve ASP.NET AJAX error handling - shows how to create more robust and meaningful error messages than the standard popups within ASP.NET AJAX.
- AJAX Automated Testing and Debugging Tools - great list of options to consider for assisting with testing and debugging of AJAX applications. Please let me know via the comments of any experiences you have had with tools on this list.