on-internet
← Community

How to sort records in grid view on click of header of a column

Stack Overflow ·

I wanted to sort a grid view by column when user clicks on a column header. Here user can click any column and grid view is sorted based on the column clicked. This is my code: <asp:GridView ID="gvEmployeeStatus" runat="server" AutoGenerateColumns="false" AllowPaging="True" PageSize="10" AllowSorting="true" OnPageIndexChanging="gvEmployeeStatus_PageIndexChanging" OnSorting="gvEmployeeStatus_Sorting" > protected void gvEmployeeStatus_Sorting(object sender, GridViewSortEventArgs e) { loginName = (String)(Session["LoginName"]); dsLoginDetail = clsBLogic.TblLogin(loginName); tblEmployeeNo = dsLogi

Comments

Sign in or sign up to comment and upvote.

No comments yet.