title: Optionally display a text in place of GridView when the GridView has no rows
body: <p>I have a basic GridView that displays a list of tasks to do (just an example)</p>
  
  <pre><code>&lt;asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" AllowSorting="True" &gt;
      &lt;Columns&gt;
          &lt;asp:BoundField DataField="todo" HeaderText="To Do" ReadOnly="True" SortExpression="todo" /&gt;
          &lt;asp:BoundField DataField="byDate" HeaderText="By When" ReadOnly="True"
  </code></pre>
  
  <p>SortExpression="byDate" />
          
      </p>
  
  <p>the data source is specified within the aspx page and it is a result set from a stored procedure</p>
  
  <pre><code>&lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="..."
        SelectCommand="pToDoList" SelectCommandType="StoredProcedure"&gt;
  &lt;/asp:SqlDataSource&gt;
  </code></pre>
  
  <p>So the rendered page presents tasks as rows of data (a row per task)</p>
  
  <p><strong>My question is</strong></p>
  
  <p>When there is not data returned by stored procedure the page remains blank. I would like to have a text instead saying  for example: "nothing to do today" </p>
  
  <p>How to do that? Thank you</p>