Sorting of the Grid View

I create a grid view with the property AutoGenerate Coloumn = true (i re-use) the grid view depend on the selection..
Please help me figure out on how to code sorting:

 Protected Sub GVGMMPage_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles GVGMMPage.Sorting
My back code:
        Select Case e.SortExpression
            Case "Gmm ID"
                GVGMMPage.DataBind()
                BuildInquiryGridView()
            Case "Gmm Name"
                GVGMMPage.DataBind()
                BuildInquiryGridView()
            Case "Gmm Desc"
                GVGMMPage.DataBind()
                BuildInquiryGridView()
            Case "Effective Date"
                GVGMMPage.DataBind()
                BuildInquiryGridView()
            Case "Maint Date"
                GVGMMPage.DataBind()
                BuildInquiryGridView()
            Case "Name Maint"
                GVGMMPage.DataBind()
                BuildInquiryGridView()
        End Select
    End Sub

My Fron code:
<asp:GridView ID="GVGMMPage" runat="server" AllowSorting="True"
   BorderColor="Black" BorderStyle="Solid" >
 <Columns>
<asp:ButtonField ButtonType="Button" CommandName="Edit" Text="Edit">
 <ControlStyle CssClass="Buttons" />
 </asp:ButtonField>
 <asp:TemplateField>
 <ItemTemplate>
 <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" CssClass="Buttons"
 OnClientClick="if(!confirm('Are you sure you want to delete this record?')) return false;"
  Text="Delete" />
   </ItemTemplate>
  </asp:TemplateField>                                          
   </Columns>
   <RowStyle BackColor="White" BorderColor="#404040" />
    <HeaderStyle ForeColor="White" HorizontalAlign="Center" BackColor="#336699" BorderColor="Black"
   BorderStyle="Solid" />
  <AlternatingRowStyle BorderColor="Black" BorderStyle="Solid" BackColor="Gainsboro" />
   <SelectedRowStyle ForeColor="Pink" />
iyufaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
All Courses

From novice to tech pro — start learning today.