We use lots of ASP.NET GridViews in our main product, FranchiseBlast.  We think it's important to make our users' browsing experience as pleasant as possible.

Today, we included a new feature to enable our users to be able to dynamically resize the columns of a GridView.  All the credit for the original source code goes to Matt Berseth who published his code on his blog: GridView column resizing.  Unfortunately, the column resize behavior was not implemented as AjaxControlToolkit Control Extender. Therefore, this morning I took his code and adapted it to be reusable as a control extender.  I have included the code here so that others can benefit from it (see at bottom of this article).  We also included small feature to improve the sort order visualization, in the GridView. Many thanks again to Matt Berseth.

 Here is a screenshot of one of the dynamic reports in FranchiseBlast.

FranchiseBlast is architectured with re-usable base classes and we do lots of things in the codebehind instead of the typical ASPX/ASCX.  Here is some sample code to programmatically add the extender to the page:


Thanks to our architecture, these five lines enable column resizing on all of the GridViews in FranchiseBlast.

Here is the source code, should anyone be interested:

GridViewResizeExtender.zip (262.87 kb)