Click here to Skip to main content
15,917,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have developed a webpart SpGridview, but my sort and paging eventhandler are not being fired. when I click on the fields to sort, everything will go blank.

I have taken these three steps

1)
dtGridView.Sorting += new GridViewSortEventHandler(dtGridView_Sorting);


2)
void dtGridView_Sorting(object sender, GridViewSortEventArgs e) 
{
}
 
dtGridView.AllowSorting = true;


3)
SPBoundField boundField;
boundField = new SPBoundField();
boundField.HeaderText = "status"
boundField.DataField = "status"
boundField.SortExpression = "status"
dtGridView.Columns.Add(boundField);


Why I am not hitting debug point in the event sort? please help
Posted
Updated 19-Jul-11 6:13am
v2

1 solution

it looks like you are not binding grid. Please have a look at this.
Optimized Paging and Sorting using Object Data Source[^]

Gridview in ASP.NET 2.0[^]

Thanks,
Jagjot
 
Share this answer
 
Comments
Member 3085185 19-Jul-11 12:47pm    
I am actually writing a wepart sharepoint using SPGridView (sharepoint gridview), and do not need to write the scripting part of the codes. My only problem is just for the event sorting to fire. Yes, of course I am binding the grid..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900