简体   繁体   中英

column sorting in ascending and descending order without using linq

I have a datagrid view called membersgridview with columns

memberaccountid
memberaccountname
ordername
orderid

how do i get the column sorting....

if i click on the column header column values in datagrid view will be sorted in ascending order..

if i click on the column header again the column values will be sorted in descending order..

i am doing windows applications using c#..

I have done the column sorting using linq , i want to do the column sorting without using linq ..

would anyone pls suggest me any ideas and any code snippets that will really helps me..

Many thanks in advance

如果网格未按原样排序,我认为您可以通过根据单击的列和排序方向输入IComparer来对网格的数据源(可能是一些收集对象)进行排序

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM