Results 1 to 7 of 7

Thread: Allowsorting not working

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    541

    Allowsorting not working

    Hello,

    I have the Allowsorting property on my gridview set to true, but for some reason the field headings don't become the sortable links I thought they should. Anyone know why this is happening? I am usng ASP.NET 2.0 and VB 2005.

    Just an FYI, I have autogenerating columns set to false.

    Thanks,

    Strick
    Last edited by stricknyn; Aug 15th, 2007 at 10:22 AM.

  2. #2
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: Allowsorting not worknig

    Have you defined what data field each column header should sort by?

  3. #3
    Hyperactive Member Rocketdawg's Avatar
    Join Date
    Feb 2003
    Location
    Back in the doghouse
    Posts
    294

    Re: Allowsorting not worknig

    as above and

    Also you need to use a dataset not a datareader (and the xmldatasource doesn't support sorting at all)
    Last edited by Rocketdawg; Aug 14th, 2007 at 03:20 PM. Reason: almost forgot

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    541

    Re: Allowsorting not worknig

    My gridview is bound to a datatable.

    Timeshifter, if you're referring to setting the sort expression property to the datafield, yes I'm doing this. It does make the headings links, but now it errors when I click the link to sort it

    Thanks,

    Strick
    Last edited by stricknyn; Aug 15th, 2007 at 09:29 AM.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    541

    Re: Allowsorting not working

    By the way, the error I get is:

    The GridView 'grdComments' fired event Sorting which wasn't handled

    Thanks,

    Strick

  6. #6
    Hyperactive Member Rocketdawg's Avatar
    Join Date
    Feb 2003
    Location
    Back in the doghouse
    Posts
    294

    Re: Allowsorting not working


  7. #7
    Addicted Member
    Join Date
    Jul 2002
    Location
    Cleveland, Ohio
    Posts
    185

    Re: Allowsorting not working

    Hey Stricknyn,

    I just had this problem and instead of manually defining the fields, I set AutoGenerateFields=true, then my columns became sortable...

    Jim P.
    "The Force will be with you, always."

    --Ben Kenobi--

Posting Permissions

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



Click Here to Expand Forum to Full Width