title: RadGrid Column Sorting on every click of the Header
body: <p>I have a <code>RadGrid</code> like below :-    </p>
  
  <pre><code>&lt;telerik:RadGrid ID="RadGrid1" runat="server" OnSelectedIndexChanged="SelectedIndexChanged"  AutoGenerateColumns="False" AllowPaging="True" 
      OnNeedDataSource="NeedDataSource" OnItemDataBound="ItemDataBound" OnItemCommand="ItemCommand"&gt;
      &lt;MasterTableView DataKeyNames="Id" CommandItemDisplay="Top"&gt;
          &lt;CommandItemTemplate&gt;
              &lt;asp:LinkButton ID="btnEditSelected" runat="server" CommandName="EditSelected" Visible='&lt;%# RadGrid1.EditIndexes.Count = 0%&gt;'&gt;&lt;img style="border:0px;vertical-align:middle;" alt="" src="images/edit.png"/&gt;Edit Selected &lt;/asp:LinkButton&gt;&amp;nbsp;&amp;nbsp;
              &lt;asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='&lt;%# Not RadGrid1.MasterTableView.IsItemInserted%&gt;'&gt;&lt;img style="border:0px;vertical-align:middle;" alt="" src="images/addrecord.png"/&gt;Add New &lt;/asp:LinkButton&gt;&amp;nbsp;&amp;nbsp;
              &lt;asp:LinkButton ID="LinkButton1" OnClientClick="if ( ! checkRowSelected()) return false;" runat="server" CommandName="DeleteSelected"&gt;&lt;img style="border:0px;vertical-align:middle;" alt="" src="images/delete.png"/&gt;Delete Selected &lt;/asp:LinkButton&gt;&amp;nbsp;&amp;nbsp;
          &lt;/CommandItemTemplate&gt; 
          &lt;Columns&gt;
              &lt;telerik:GridBoundColumn DataField="Name" HeaderText="Name" ItemStyle-VerticalAlign="Top" HeaderStyle-Font-Bold="true" HeaderStyle-Font-Size="Small" HeaderStyle-ForeColor="Black"&gt;
              &lt;/telerik:GridBoundColumn&gt;
              &lt;telerik:GridHyperLinkColumn HeaderText="WebSite" DataTextField="WebSite" DataTextFormatString="{0}" DataNavigateUrlFields="WebSite" DataNavigateUrlFormatString="{0}"
                  ItemStyle-VerticalAlign="Top" HeaderStyle-Font-Bold="true" HeaderStyle-Font-Size="Small" HeaderStyle-ForeColor="Black" Target="_blank" &gt;
              &lt;/telerik:GridHyperLinkColumn&gt;
              &lt;telerik:GridBoundColumn DataField="Notes" HeaderText="Notes" ItemStyle-VerticalAlign="Top" HeaderStyle-Font-Bold="true" HeaderStyle-Font-Size="Small" HeaderStyle-ForeColor="Black"&gt;
              &lt;/telerik:GridBoundColumn&gt;      
          &lt;/Columns&gt;
      &lt;/MasterTableView&gt;
  &lt;/telerik:RadGrid&gt;
  </code></pre>
  
  <p>Now I want the <code>Name</code> Column to be 'sortable' alphabetically so if someone clicks the word "Name", they get alpha and reverse alpha sorting with every other click.</p>
  
  <p>So that the sort order changes(to alternate sort) with every click on the Header "Name".</p>
  
  <p>I have a little idea of sorting the column on Header click. But the same column should be sorted in reverse order on the second time click of the Header (and vice-versa).</p>
  
  <p>Could anyone help me how to accomplish this , or any ideas , ThankYou ! </p>