This is a migrated thread and some comments may be shown as answers.

[Solved] Automatic grouping when columns are selected

0 Answers 7 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Pavel
Top achievements
Rank 1
Pavel asked on 02 Jun 2011, 02:34 AM
I'm considering using the grid for a reporting application and wonder if it can be adapted for our needs.

I have table comparable to the following (but much wider):
id  color  size    quantity
1   red    small     2
2   red    big       3
3   blue   small     5
4   blue   big       7
5   green  small     11
I want to show columns color, size, and quantity, and want to allow the user to not show the column size or color, and always show quantity as an aggregate.  For example, if color, size, and quantity are the columns, the grid looks like the table above without the id column.  If color and quantity are the columns, I would like to see:
color    quantity
red      5
blue     12
green    11

If size and quantity are columns, I would like to see:
size    quantity
small   18
big     10

My data is coming from LINQ to SQL.  In reality I have many more columns, two of which are aggregates, the rest of which I would like to allow the user to unselect, and have the aggregates update correctly (when the size column is not visible, I don't want to see two rows with red).

Is this supported with the MVC grid and LINQ to SQL?  Is there a way to do this with the grid?
Tags
Grid
Asked by
Pavel
Top achievements
Rank 1
Share this question
or