Bidirectional Sorting on Any Column in DataGrid
page 2 of 7
by Pani Baruri & Abhijit Mandrekar
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 25239/ 47

Part 1: Using SortExpression Properly

Design Time:

 

  1. Drag and drop a DatGrid on the form.
  2. Set AllowSorting property of the grid to True.
  3. Set AutogenerateColumns property of the grid to False.
  4. Add bound columns to datagrid and set their properties as follows. The sortexpression property refers to the name of column in database table.

 

Note: Employees table from Northwind database is being used to illustrate the purpose.

 

DataTextField

Header Text

Sort Expression

EmployeeID

Employee ID

EmployeeID ASC

LastName

Last Name

LastName ASC

FirstName

First Name

FirstName ASC

Title

Title

Title ASC

City

City

City ASC

Country

Country

Country ASC

 

 


View Entire Article

User Comments

Title: Bidirectional Sorting on Any Column in DataGrid   
Name: brian
Date: 2007-08-08 10:39:14 PM
Comment:
thanks a lot.It really very helpful
thumb up

Product Spotlight
Product Spotlight 





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


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-19 8:45:54 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search