title: How to Sort the GridView column in ASP.net Web Application
body: <p>I have created web form using master page in my Web application.And i have created GridView and i want to sort the columns.My gridview design as follows:</p>
  
  <pre><code>&lt;div id="GridPopUp" runat="server"&gt;
  &lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns = "false"  DataKeyNames="sno"  CssClass = "grid" &gt;
      &lt;Columns&gt;
          &lt;asp:TemplateField  ItemStyle-Width="200px"&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:CheckBox  ID="cbCheck" runat="server"/&gt;
              &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
  
          &lt;asp:BoundField ItemStyle-Width="200px" DataField="sno" HeaderText="sno"  /&gt;
          &lt;asp:BoundField ItemStyle-Width="200px" DataField="itemcode" HeaderText="ItemCode" /&gt;
          &lt;asp:BoundField ItemStyle-Width="200px" IDataField="itemname" HeaderText="ItemName"  /&gt;
          &lt;asp:BoundField ItemStyle-Width="200px" DataField="unit" HeaderText="Unit"  /&gt;
          &lt;asp:BoundField ItemStyle-Width="200px" DataField="price" HeaderText="Price"  /&gt;
          &lt;asp:BoundField ItemStyle-Width="200px" DataField="qty" HeaderText="Qty"  /&gt;
           &lt;asp:TemplateField ItemStyle-Width="200px" &gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:LinkButton ID="lnkSelect" runat="server" Text="Select" CommandName = "Select" OnClientClick = "return GetSelectedRow(this)" /&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
  
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  &lt;/div&gt;
  </code></pre>