datagridview column sort problem

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

Hi!

I have a DatagridView lists some vehicles. Each column sort mode is set to
Automatic. However, I cannot sort any column.

Can this be related with the datasource? I have this code:

List<Vehicle> myList;

myList = new List<Vehicle>();
myList.addRange(myFunction()); //Access to a web Service
myGrdi.DataSource = myList;

Thanks in advance!

MP
 
Hi marco

try something like this

myGrdi.Sort(myGrdi.Columns[0], ListSortDirection.Ascending);
 
Back
Top