Bidirectional Sorting on Any Column in DataGrid
page 1 of 3
Published: 23 Nov 2003
Unedited - Community Contributed
Abstract
The purpose of this article is to sort data displayed in datagrid in ascending or descending direction and reverses the direction of the sort automatically each time user clicks the column in datagrid. This article is divided into two parts. The first part uses sortexpression property of the column for sorting and the latter part uses dynamic attributes property of datagrid and dataview class for sorting.
by Pani Baruri & Abhijit Mandrekar
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 19658/ 38

Introduction

The purpose of this article is to sort data displayed in datagrid in ascending or descending direction and reverses the direction of the sort automatically each time user clicks the column in datagrid. This article is divided into two parts. The first part uses sortexpression property of the column for sorting and the latter part uses dynamic attributes property of datagrid and dataview class for sorting.

Advantages

  • This kind of sorting can be applied to any number of desired columns you want data to be sorted. 
  • It reverses the sort direction each time automatically for each column.

 


View Entire Article

User Comments

Title: Not bad but, not what I want.   
Name: AK
Date: 2007-08-02 1:34:42 AM
Comment:
I want sorting and paging in a grid view in asp.net 2.0 which is dynamically binded i.e. some times it has 3 columns or some time 4, 5, 6 or more columns.
Please suggest possible solution.

Thanks in advance,
AK
Title: Mr   
Name: John
Date: 2007-01-24 9:27:50 AM
Comment:
Thanx a lot if its not i never be saved
Title: great   
Name: mohsin
Date: 2006-10-18 5:52:20 AM
Comment:
Thats a great solution,very comprehensive and easy to understand and ...
Title: mr   
Name: rutts
Date: 2006-09-29 6:53:38 AM
Comment:
code is much helpful to solve my doubt regarding dataview
Title: Ms   
Name: Renee
Date: 2006-04-20 7:49:38 PM
Comment:
Thank you, this is awesome. Easy to follow and nice solution.
Title: Mr   
Name: Arif
Date: 2006-01-12 4:18:59 AM
Comment:
Thank you very much for your help. This ia a great article which works straight out of the box.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-23 6:20:01 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search