Sorting a gridview bound to a list of custom generic objects

awadeomneme

New Member
I'm trying to find a good tutorial of how to sort a gridview with multiple columns (strings, dates, decimals, etc) bound to a generic list of custom objects. \[code\]MyObject.vb:Public Property IdPublic Property NamePublic Property DatePublic Property AmountMyObjects.aspx.vb:gridView.DataSource = GetMyObjects()gridView.DataBind()GetMyObjects() returns a List of MyObject\[/code\]I need to be able to click on column headers of the grid to sort and reverse sort, and be able to store the sort direction in ViewState so the direction toggles each time I click on a column header. It seems like MyObject would need to implement IComparable, but exactly how it all comes together, I'm not so sure.Any help is appreciated...Thanks!
 
Back
Top