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

Sort datagridview with list as datasource 1

Status
Not open for further replies.

malaygal

IS-IT--Management
Feb 22, 2006
192
US
I have multiple datagridview in my form, each bound to different list (of generic objects).
I need to create one routine to sort (thru Column Header Click) of any of these datagridviews.
I have a code that hard-code the field of the datasource as:

_dsrc.OrderBy(Function(x) CInt(x.ID)).ToList

But I need to write a code that will handle all of them without hard-coding.
Been searching for days online, but unable to find any.

Any help will be greatly appreciated.
 
Try using a BindingList, as in this article:



I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top