Click here to Skip to main content
15,905,867 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
It is my code
this.dataGrid1.Allowsort  (this .dataGridTextBoxColumn1,ListSortDirection.Descending );


What I have tried:

this.dataGrid1.Allowsort (this .dataGridTextBoxColumn1,ListSortDirection.Descending );
Posted
Updated 14-Mar-17 6:50am
Comments
CHill60 14-Mar-17 12:32pm    
Shouldn't that be AllowSorting?
You haven't said what the problem is.
Have you checked out the documentation - DataGrid.AllowSorting Property (System.Web.UI.WebControls)[^]

1 solution

You should set Column SortMode to Programmatic like in snippet below

C#
dataGridView1.Columns[0].SortMode =  DataGridViewColumnSortMode.Programmatic;
 
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