none
Displaying 2 rows of columns in a datagrid ? RRS feed

  • Question

  • I need to create a dotnet report (webform.aspx) using visual studio 2003.
    In the below format I need to display.

    Date                               12am - 1am                                  1am - 2am                           2am - 3am
                          0-15 min   15-30 min  >30 min    0-15 min   15-30 min   >30 min    0-15 min   15-30 min  >30 min 

    2009-10-20       538            25              3             445          22              2               223           16              1
    2009-10-19       522            23              4             398          20              2               245           15              2
    2009-10-18       602            18              2             444          19              1               312           17              1

    Table is as follows...

    Date             total15    total30    total30_plus    hours
    2009-10-20      538         25             3                 0 
    2009-10-20      445         22             2                 1

    hours = 0 means its 12-1 am and hours = 1 means its 1-2 am and likewise...

    I need to use datagrid. I have done before but since here 2 rows of columns are there (hours and mins) I am bit confused. t-sql Stored Procedure will be returning the data and I will be binding it to the dataset. I guess I need to enable AutoGenerateColumns for the datagrid.
       But how do I return data from the SP with hours and mins in seperate rows? Under each hours category I need to have 3 seperate mins columns. Is it possible to have this in same datagrid or I need to use 2 datagrids?
       I guess I posted in right category or is it more appropriate to post it in t-sql category?
     Please suggest. Thanks.
    Thursday, October 22, 2009 6:07 AM