Click here to Skip to main content
15,911,132 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to apply sort in datagridview columns header when using binding list in c# winforms

Grid columns are created dynamically in Winforms.auto sort is not work for binding list.
Posted
Updated 21-Mar-16 19:49pm
v2

Hi The datagridview sorting for a list could be achieved by

1) converting the List object to an IBinding interface IBinding interface[^]

2) By using the ColumnHeaderMouseClick event in the datagridview
refer these
Sorting a DataGridView with a Generic List as DataSource [^]
enable DataGridView sorting when user clicks on the column header [^]

3) Converting your List to a datatable
convert a list into data table [^]
List to Datatabe[^]
Convert List to DataTable [^]
 
Share this answer
 
this codeproject article might be helps you to get started,
Implementing a Sortable BindingList Very, Very Quickly[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900