title: ASP .NET GridView not showing sorting arrows
body: <p>I have the following Gridview. I need sorting arrows in every column header for sorting. I have set AllowSorting property to true.But it is not showing the arrows.Additionally, I added SortExpression to template fields .Still it is not showing the sorting arrows. I couldn't understand the issue. How can I fix this issue? 
  The code is given below</p>
  
  <pre><code>&lt;asp:GridView ID="dgvCatReport" runat="server"
                AutoGenerateColumns="False" CellPadding="4"
                ForeColor="#333333" GridLines="None"
                AllowPaging="True"
                AllowSorting="true"
                OnPageIndexChanging="dgvCatReport_PageIndexChanging"
                PagerSettings-Mode="NumericFirstLast"
                PagerSettings-Position="TopAndBottom"
                PageSize="10"
                CssClass=" table table-striped  table-hover"
                AlternatingRowStyle-CssClass="alt"
                PagerStyle-CssClass="bs-pagination"&gt;
      &lt;columns&gt;
          &lt;asp:templatefield headertext="Category Name" sortexpression="CatName"&gt;
              &lt;itemtemplate&gt;
  
                  &lt;h5&gt;&lt;%# Eval("CatName") %&gt;&lt;/h5&gt;
  
              &lt;/itemtemplate&gt;
              &lt;headerstyle horizontalalign="Left" /&gt;
              &lt;itemstyle width="200px" /&gt;
          &lt;/asp:templatefield&gt;
  
          &lt;asp:templatefield headertext="Total Views" sortexpression="ReportCount"&gt;
              &lt;itemtemplate&gt;
                  &lt;span&gt;&lt;%# Eval("ReportCount") %&gt;&lt;/span&gt;
  
              &lt;/itemtemplate&gt;
              &lt;headerstyle horizontalalign="Left" /&gt;
              &lt;itemstyle width="75px" /&gt;
          &lt;/asp:templatefield&gt;
  
  
          &lt;asp:templatefield headertext="Daily Views" sortexpression="DailyCount"&gt;
              &lt;itemtemplate&gt;
                  &lt;span&gt;&lt;%# Eval("DailyCount") %&gt;&lt;/span&gt;
  
              &lt;/itemtemplate&gt;
              &lt;headerstyle horizontalalign="Left" /&gt;
              &lt;itemstyle width="75px" /&gt;
          &lt;/asp:templatefield&gt;
  
          &lt;asp:templatefield headertext="Weekly Views" sortexpression="WeeklyCount"&gt;
              &lt;itemtemplate&gt;
                  &lt;span&gt;&lt;%# Eval("WeeklyCount") %&gt;&lt;/span&gt;
  
              &lt;/itemtemplate&gt;
              &lt;headerstyle horizontalalign="Left" /&gt;
              &lt;itemstyle width="75px" /&gt;
          &lt;/asp:templatefield&gt;
  
          &lt;asp:templatefield headertext="Monthly Views" sortexpression="MonthlyCount"&gt;
              &lt;itemtemplate&gt;
                  &lt;span&gt;&lt;%# Eval("MonthlyCount") %&gt;&lt;/span&gt;
  
              &lt;/itemtemplate&gt;
              &lt;headerstyle horizontalalign="Left" /&gt;
              &lt;itemstyle width="75px" /&gt;
          &lt;/asp:templatefield&gt;
      &lt;/columns&gt;
  
      &lt;%--   &lt;pagersettings mode="NumericFirstLast" position="TopAndBottom"&gt;&lt;/pagersettings&gt;
  
      &lt;pagerstyle backcolor="White" cssclass="pgr"&gt;&lt;/pagerstyle&gt;--%&gt;
  &lt;/asp:GridView&gt;
  </code></pre>