Results 1 to 2 of 2

Thread: Gridview Sorting Trouble

  1. #1
    Junior Member
    Join Date
    Aug 12
    Posts
    17

    Gridview Sorting Trouble

    I have a gridview and a few datasources on my web page. In the code behind, I set the gidview's SqlDataSourceId based on which checkbox is checked.
    I allowed sorting for the gridview. For some reason, some of the columns get sorted when I click on it, and some don't sort at all. Do you know what may be causing this?
    Thank you.

  2. #2
    Fanatic Member KGComputers's Avatar
    Join Date
    Dec 05
    Location
    www.vbforums.com
    Posts
    550

    Re: Gridview Sorting Trouble

    I assume this is asp.net right?

    Have you applied sorting expression for each bound columns
    similar to the code below?

    Code:
    <asp:BoundField HeaderText="Customer Code" 
                      DataField="CustomerID" SortExpression="CustomerID">
                    </asp:BoundField>
    Cheers!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •