I need to show the user in a grid 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 Pivot Columns in SQL Server 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.S. I am using Obout Grid to display the data.
<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">
<Columns>
<obout:Column DataField="name" HeaderText="Status" />
<obout:Column DataField="statusTotal" HeaderText="Total"/>
</Columns>
<ScrollingSettings ScrollWidth="100%" />
<FilteringSettings FilterLinksPosition="TopAndBottom" FilterPosition="Top" />
</obout:Grid>
But I can't use that format, the columns has to be each status.