DataGrid SortCommand Will Not Fire

Discussion in 'ASP .Net' started by Joey, Oct 24, 2006.

  1. Joey

    Joey Guest

    I have an asp.net 1.1 C# web application with a datagrid. I set the
    datagrid's "AllowSorting" property to "True". Then I created a sort
    function for it by selecting the datagrid in the designer, then the
    Event button in the Properties window, and then double clicking in the
    "SortCommand" box. Then in the function that was created for me, I
    entered my code.

    Now, the datagrid will not sort. I planted a breakpoint on the first
    line of code in the sort function. When I run the application and click
    one of the underlined column headers, the page does a postback, but the
    sort event does not fire - the breakpoint is never hit.

    I have checked in the "Region" section to make sure that the hook is
    there for the sort event handler - it is. I even tried recreating the
    sort function and even the datagrid itself, but that didn't work
    either. I don't know what else to try. Everything is configured
    properly, but it just doesn't work. I have never seen this before.

    Does anyone have any ideas on how to fix this?
    Joey, Oct 24, 2006
    #1
    1. Advertising

  2. Joey

    Guest

    Have you also gone into the Property Builder for the DataGrid and set
    the "Sort expression" property for each of your sortable columns?


    Joey wrote:
    > I have an asp.net 1.1 C# web application with a datagrid. I set the
    > datagrid's "AllowSorting" property to "True". Then I created a sort
    > function for it by selecting the datagrid in the designer, then the
    > Event button in the Properties window, and then double clicking in the
    > "SortCommand" box. Then in the function that was created for me, I
    > entered my code.
    >
    > Now, the datagrid will not sort. I planted a breakpoint on the first
    > line of code in the sort function. When I run the application and click
    > one of the underlined column headers, the page does a postback, but the
    > sort event does not fire - the breakpoint is never hit.
    >
    > I have checked in the "Region" section to make sure that the hook is
    > there for the sort event handler - it is. I even tried recreating the
    > sort function and even the datagrid itself, but that didn't work
    > either. I don't know what else to try. Everything is configured
    > properly, but it just doesn't work. I have never seen this before.
    >
    > Does anyone have any ideas on how to fix this?
    , Oct 24, 2006
    #2
    1. Advertising

  3. Joey

    Joey Guest

    Yes, I had done that.

    Anyways, I rebuilt the page from scratch and it works now. I don't know
    what was going on before...it was really wierd.

    wrote:
    > Have you also gone into the Property Builder for the DataGrid and set
    > the "Sort expression" property for each of your sortable columns?
    >
    >
    > Joey wrote:
    > > I have an asp.net 1.1 C# web application with a datagrid. I set the
    > > datagrid's "AllowSorting" property to "True". Then I created a sort
    > > function for it by selecting the datagrid in the designer, then the
    > > Event button in the Properties window, and then double clicking in the
    > > "SortCommand" box. Then in the function that was created for me, I
    > > entered my code.
    > >
    > > Now, the datagrid will not sort. I planted a breakpoint on the first
    > > line of code in the sort function. When I run the application and click
    > > one of the underlined column headers, the page does a postback, but the
    > > sort event does not fire - the breakpoint is never hit.
    > >
    > > I have checked in the "Region" section to make sure that the hook is
    > > there for the sort event handler - it is. I even tried recreating the
    > > sort function and even the datagrid itself, but that didn't work
    > > either. I don't know what else to try. Everything is configured
    > > properly, but it just doesn't work. I have never seen this before.
    > >
    > > Does anyone have any ideas on how to fix this?
    Joey, Oct 24, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ken Tucker
    Replies:
    2
    Views:
    2,546
    Ken Tucker
    Jul 6, 2003
  2. John Sturgeon

    DataGrid SortCommand event not triggered

    John Sturgeon, Nov 26, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    572
    John Sturgeon
    Dec 2, 2003
  3. Ole
    Replies:
    0
    Views:
    142
  4. ae
    Replies:
    2
    Views:
    114
    venuprs
    Apr 8, 2005
  5. biru
    Replies:
    2
    Views:
    218
Loading...

Share This Page