Render ASP.NET GridView Control with Resizable Column Header
3 Comments Published by John Eric Sobrepena on Jan 9, 2010
Make the column headers of ASP.NET GridView control user-resizable with this three easy steps.
- Download the JavaScript file from here.
- Include the JavaScript file into your ASPX page.
- Finally, initialize the component for your GridView control by inserting this JavaScript code at the end of your ASPX page.
var _ResizeTableHeaderDecorator = new ResizeTableHeaderDecorator({ GridID: "<%=GridView1.ClientID %>" });
Replace "GridView1" by the ID of the GridView control you want to enable column resizing.
Column 1 | Column 2 | Column 3 | Column 4 | Column 5 | Column 6 | Column 7 |
---|---|---|---|---|---|---|
Orange | Orange | Drive Sample | Great | Orange | Gateway | Gateway |
Apple Drive | Doorway | Apple | Drive | Apple | Orange Doorway | Drive Sample |
Great Apple | Gateway Gateway | Apple | Drive | Apple | Sample Drive | Sample Orange |
Gateway | Doorway Doorway | Great | Great | Great Orange | Orange Doorway | Doorway Drive |
Drive | Sample | Apple | Gateway | Apple Great | Orange Great | Orange Gateway |
Gateway | Sample Drive | Sample Drive | Apple Apple | Orange Gateway | Drive | Gateway |
Great Drive | Gateway | Drive | Great Doorway | Doorway | Orange | Doorway Sample |
Gateway | Doorway | Great Doorway | Great Orange | Sample Doorway | Orange Apple | Sample |
Drive | Great Gateway | Apple Apple | Gateway Orange | Drive | Gateway | Drive |
Drive | Drive | Orange | Drive | Great | Doorway | Great Sample |
Great Sample | Sample Sample | Drive Sample | Apple Great | Great Sample | Gateway Orange | Great |
Great | Orange Gateway | Apple Doorway | Great Gateway | Drive | Apple Great | Great Great |
Orange | Great | Apple Sample | Great Drive | Doorway | Doorway | Great Great |
Orange | Drive | Doorway | Doorway | Gateway | Drive | Doorway Drive |
Orange Gateway | Sample Apple | Apple Orange | Orange Gateway | Sample | Drive | Great Orange |
Doorway Drive | Orange | Apple Doorway | Sample Orange | Orange | Sample | Apple Great |
Gateway | Gateway Orange | Apple Apple | Gateway Apple | Great Orange | Doorway Great | Great |
Doorway | Sample | Great Gateway | Drive Apple | Great | Orange Great | Orange Sample |
Sample Great | Apple | Sample Sample | Doorway Apple | Gateway | Orange | Apple Doorway |
Sample | Drive | Great Orange | Sample | Doorway Gateway | Doorway | Orange Apple |
Labels: AJAX Control Toolkit, ASP.NET, CodePlex, Columns, CoolGridView, GridView, Header, IdeaSparks, Resizable, Resize, Resizeable, UpdatePanel
Hi John,
Great extension for Gridview.
Getting design time error when dropping component to design window:
error rendering control
at runtime it is working fine.
couldnt found the Javascript in the link and the Live example does not have the property either..
Hi, John
How do I freeze the first column ??