title: Best approach to set status count to ASP Grid?
body: <p>I need to show the user <strong>in a grid</strong> the count of establishments that has each active status in the application. I already have the query but obviously it returns me 2 columns, one with the status name and one with the count. Should I use something like <a href="https://stackoverflow.com/questions/14797691/dynamic-pivot-columns-in-sql-server">Pivot Columns in SQL Server</a> and set the columns names and properties on the fly using row[0] or there is a better approach for what I need to do?</p>
  
  <p>P.S.
  I am using Obout Grid to display the data.</p>
  
  <pre><code>&lt;obout:Grid ID="gridStatus" runat="server" FolderStyle="~/obout/grid/styles/style_6"
              AllowAddingRecords="False" AutoGenerateColumns="False" AllowColumnReordering="True"
              PageSize="10" ShowTotalNumberOfPages="True" AllowManualPaging="True" AllowFiltering="True"
              AllowMultiRecordSelection="false"
              PageSizeOptions="10,20,30,40,50,100,500,999"&gt;
              &lt;Columns&gt;
                  &lt;obout:Column DataField="name" HeaderText="Status" /&gt;
                  &lt;obout:Column DataField="statusTotal" HeaderText="Total"/&gt;
              &lt;/Columns&gt;
              &lt;ScrollingSettings ScrollWidth="100%" /&gt;
              &lt;FilteringSettings FilterLinksPosition="TopAndBottom" FilterPosition="Top" /&gt;
          &lt;/obout:Grid&gt;
  </code></pre>
  
  <p>But I can't use that format, the columns has to be each status.</p>