Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > DataGrid SortCommand Will Not Fire

Reply
Thread Tools

DataGrid SortCommand Will Not Fire

 
 
Joey
Guest
Posts: n/a
 
      10-24-2006
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?

 
Reply With Quote
 
 
 
 
paul.gibson@i-stat.com
Guest
Posts: n/a
 
      10-24-2006
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?


 
Reply With Quote
 
 
 
 
Joey
Guest
Posts: n/a
 
      10-24-2006
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.

http://www.velocityreviews.com/forums/(E-Mail Removed) 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?


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid SortCommand Event not fired on dynamically generated datagrid biru ASP .Net Web Controls 2 05-06-2005 01:38 PM
SortCommand event does not fire when ViewState is disabled ae ASP .Net Web Controls 2 04-08-2005 06:41 PM
Custom Control inheriting from DataGrid - SortCommand, PageIndexChanged not working Ole ASP .Net Building Controls 0 02-10-2004 12:48 PM
DataGrid SortCommand event not triggered John Sturgeon ASP .Net 2 12-02-2003 07:14 PM
DataGrid SortCommand not firing using code-behind?? Ken Tucker ASP .Net 2 07-06-2003 03:59 AM



Advertisments