Geek Articles

Categories

 

Subscribe

Daily Updates Subscribe geekarticles update via email Subscribe geekarticles update via RSS

 
GeekArticles Database SQL Server

Improving the Sort Arrows GridView Control

Author: aspnet.4guysfromrolla.com | Published: 6th Feb 2008 | Visited: 128 times | Add Comment
Filed in: SQL Server

While the GridView control offer built-in, bi-directional sorting support, there is no visual feedback as to what column the data is sorted by. To remedy this shortcoming, I showed how to create a custom server control that extended the GridView class and automatically added arrow up and down images to the appropriate column header, thereby clearly showing what column the data was sorted by and whether the data was sorted in ascending or descending order. Read Extending the GridView to Include Sort Arrows for more information on this technique. Since publishing that article, I have received a lot of great feedback and suggestions for improving the control. 4Guys reader Richard Deeming proposed a better technique for adding the arrow images to the appropriate GridView header cell, one that removed the hacks that my approach required. Another great suggestion came from Tom Mason, who proposed using a differing CSS class in lieu of <img> elements in the header. Tom's ideas prompted me to add two new properties to the custom GridView control: SortAscendingStyle and SortDescendingStyle. Use these properties to customize the appearance of the sorted header cell. Read on to learn more about these enhancements! Read More >

Read Article
 

Sponsored Links

 


Related Articles

 Simple (non-JS) GridView Delete Confirmation A simple server-side solution for displaying a confirmation message upon Deleting an item in a Grid ...

 .NET Building Blocks: Custom User Control Fundamentals Find out the gritty details required to create, test, use, inherit, install, and distribute .NET User Controls of all ty ...

 Scrollable Gridview with Freeze header and sort image. this is an easy way to get Freeze GridView header and add image sort. And it works on IE,Firefox and Others. work inside and outside of updatepa ...

 Multiple File Upload User Control This article describes how to create an user control with event & propert ...

 ListView Header Sort Direction Indicators Writing an ASP.NET Custom Control which extends the ListView to visually show sort direction for colu ...

 Tile Editor Control A control to edit maps or small pictures in tile f ...

 Control LED lights on your Dell XPS Laptop Utilze Dell's XPS Light FX API to create your own LED eff ...

 Improving the GridView sorting capabilities with Google Analytics features Improve the column sorting of the ASP.NET GridView to give the user a better visual experience. Highlight the column selected for sorting and include an image to indicate whether the sorting order is ascending or descend ...

 Hover Effects To The GridView Rows Using The CSS This article describes how to apply hover effects on the GridView rows using ...

 A Fine-looking Segmented LED Control This article describes an approach to constructing a segmented LED displ ...



Next: Working Around ASP.NET's HyperLink ImageUrl Bug



Post Comment

Name:


Email:
 (Optional. Used for Notification)

Title:

 
Comment:


Validation Code:
 <=>  (Enter this code in text box)





Latest Articles

 

Popular Articles

Sponsored Links