Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGrid Sort Event Not Firing

Status
Not open for further replies.

feemi

Programmer
Feb 3, 2001
17
US
I have the following datagrid

<asp:DataGrid
id=&quot;grdSearchResults&quot;
runat=&quot;server&quot;
Width=&quot;544px&quot;
Height=&quot;93px&quot;
CssClass=&quot;StandardFont&quot;
AllowSorting=&quot;True&quot;
OnSortCommand=&quot;grdSearchResults_SortCommand&quot;
BorderStyle=&quot;Solid&quot;
BorderColor=&quot;Maroon&quot;
EnableViewState=&quot;False&quot;
AutoGenerateColumns=&quot;False&quot;
ShowFooter=&quot;True&quot;
SelectedItemStyle-Width=&quot;50&quot;
ItemStyle-Width=&quot;50&quot;
CellSpacing=&quot;0&quot;
CellPadding=&quot;0&quot;>

This event never fires.

Sub grdSearchResults_SortCommand(ByVal s As Object, ByVal e As DataGridSortCommandEventArgs)

blah blah blah

End Sub

Any ideas on why my sort routine isn't firing?

Thanks
 
Try adding a Handles modifier to the sub and see if that works. I always had better luck using that approach when wiring handlers:

Sub grdSearchResults_SortCommand(ByVal s As Object, ByVal e As DataGridSortCommandEventArgs) Handles grdSearchResults.SortCommand

-paul

ps. I've never had wierdness like this occur with C#. It's a superior language that just flat out seems to work better, IMHO.

penny.gif
penny.gif

The answer to getting answered -- faq855-2992
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top