sort columns of gridview in asp.net c#

前端 未结 7 435
别那么骄傲
别那么骄傲 2020-12-17 00:43

Can anyone tell the function to sort the columns of a gridview in c# asp.net.

The databound to gridview is from datacontext created using linq. I wanted to click th

7条回答
  •  甜味超标
    2020-12-17 01:28

    When I do that Alone it gives an error "The GridView 'GridView1' fired event Sorting which wasn't handled.

    I've had that happen before... I've just created a throwaway handler, and then everything seemed to start working after that. Not the prettiest solution, but it worked for me.

    That said, I didn't see any reference to a data source in your GridView code. You'll need something like this:

    
    

    And then in your GridView:

    
    

提交回复
热议问题