开发者

column sorting in ascending and descending order without using linq

开发者 https://www.devze.com 2023-04-02 21:31 出处:网络
I have a datagrid view called membersgridview with columns memberaccountid memberaccountname开发者_运维知识库

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


If the grid doesn't sort as-is, I think you could sort the datasource of the grid, probably some collection object, by feeding in an IComparer depending on the clicked column and sort direction

0

精彩评论

暂无评论...
验证码 换一张
取 消