title: Row Number Generate Automatically for all pages continuously in grid view in Asp.net?
body: <p>I want to generate row number in gridview auotmatically for all pages continuously.
  For EG: I have 3 pages on gridview of records 150. Each page contains 50 records. </p>
  
  <blockquote>
    <p>I want to display row number for all records in a grid from 1 to 150
    continuously.</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"&gt;
  &lt;Columns&gt;
      &lt;asp:TemplateField HeaderText = "Row Number" ItemStyle-Width="100"&gt;
          &lt;ItemTemplate&gt;
              &lt;asp:Label ID="lblRowNumber" Text='&lt;%# Container.DataItemIndex + 1 %&gt;' runat="server" /&gt;
          &lt;/ItemTemplate&gt;
      &lt;/asp:TemplateField&gt;
      &lt;asp:BoundField DataField="Name" HeaderText="Name" ItemStyle-Width="150" /&gt;
      &lt;asp:BoundField DataField="Country" HeaderText="Country" ItemStyle-Width="150" /&gt;
  &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>It display row number on each page starting from 1 to 50 . I actually want number from 1 to 150 . Anyone please help me if you have any idea.Thanks in Advance.</p>