DataGrid SortCommand Will Not Fire

  • Thread starter Thread starter Joey
  • Start date Start date
J

Joey

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?
 
Have you also gone into the Property Builder for the DataGrid and set
the "Sort expression" property for each of your sortable columns?
 
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.
 
Back
Top