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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sort Datagridview by multiple columns 2

Status
Not open for further replies.

tmar

MIS
Mar 24, 2007
62
US
I have a detached datagrid that gets populated through a SQL statement but then gets manipulated by the end user who will changes some of the column values and delete some rows. In the end I need to sort that datagrid by 3 of the columns before processing the data in it.

Nevermind just figured it out. For those interested its as follows:
Me.grdPurchasing.Sort(Me.grdPurchasing.Columns(7), ComponentModel.ListSortDirection.Ascending)
Me.grdPurchasing.Sort(Me.grdPurchasing.Columns(26), ComponentModel.ListSortDirection.Ascending)
Me.grdPurchasing.Sort(Me.grdPurchasing.Columns(25), ComponentModel.ListSortDirection.Ascending)

 

It would seem to me that the entire grid would be sorted in the order of the final .Sort (Col 25) rather than sorted by three columns...?

.Sort (Col 7)
.Sort (Col 26)
.Sort (Col 25)

vs.

.Sort(Col 7, Col 26, Col 25)


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top