Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sorting data in a datagrid

Status
Not open for further replies.

DeepBlerg

Technical User
Jan 13, 2001
224
0
0
AU
Hi,
how would i sort data in rows numerically in a datagrid depending on data in one coloumn?

thanks.
 
Hi Deepblerg

I do it like this.
Adodc1 is a adodc datacontrol connected to a database.
The datagrid is set like this:
Set Datagrid1.DataSource = Adodc1

Than you can sort every column in a wanted direction up or down like this:

With Adodc1.Recordset
.Sort = .Fields(ColChosen).Name & " ASC"
End With
Colchosen is the selected column.

or down with:

.Sort = .Fields(ColChosen).Name & " DESC"

Hope this works for you (I use VB6/Access2000 database)
ICET
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top