views:

308

answers:

0

Here's a link to the Dashboard page that I'm trying to built (image of the old implementation) Dashboard

So, basically the Grid needs the following features:

  1. Parent-child cascading (only 1 level) - the yellow row are parent Grid which expand-collapse (simple js trick).

  2. The whole Grid needs to have a 'frozen' header. As you can see in the image provided - the scrolling happens beneath the fix header.

  3. The fix Grid header needs to have sorting (applicable to the Child Grid records). Parent Grid doesn't have much - its just a single row.

  4. And finally I need to be able to bring the whole structure in an excel report (possibly 'as it is').


Here's the old\existing implementation:

  1. I've a parent-Grid which has a single column and another template column in which I've my child-Grid. In code I fetch all the parent/child records in two separate lists (I'm using LINQ to SQL). Then I bind parent list to the parent-grid. In the Grid's Data_Bound event - I iterate for each parent-row and fetch relevant child records from the other list and assign that child-list to the child-grid control instance and then data bind it.

  2. For frozen header, I've used a table of static links above the main Grid.And to align the columns of these two tables - I use the 'spacer image' concept. I add a blank row in which there's a spacer image and so the column stays expanded as per the image-width. For scrolling - I've a div with style:

    style='width: 100%; height: 190px; overflow-x: hidden;overflow-y: scroll;'

  3. I've an external manual sorting at place which 'overrides' the Grid sorting (no sorting in Grid because I've hidden the header rows)

  4. This one's a bit tricky but works fine - I've simply 'dumped' the whole hierarchy as an html table layout. And then I save/respond it as an xls file stream. In short, I render it as html but then save it as .xls - it works!

Any better suggestions are welcome!

Thanks.