Blankman
Blankman

Reputation: 267040

.net grid to display rows, and also have option to group by

Does the gridview have any 'group by' functionality?

I need to display a table in the gridview, then allow for sorting on all the database table columns.

I also need to be able to 'group by' on some columns.

Any examples of this kind of functionality?

Upvotes: 1

Views: 680

Answers (3)

Rob
Rob

Reputation: 45771

Take a look at the GridViewHelper code here: http://www.agrinei.com/gridviewhelper/gridviewhelper_en.htm, I've used it and found it works a treat

Upvotes: 1

patjbs
patjbs

Reputation: 4772

Sorting in gridview will result in, effectively, a grouping. Say you have the data:

ID  Item
110 Pineapple
111 Orange
112 Apple
113 Pineapple

Sorting by the Item column would result in:

112 Apple
111 Orange
110 Pineapple
113 Pineapple

Are you looking for something else?

Upvotes: 0

Keltex
Keltex

Reputation: 26426

Unfortunately the built-in gridview doesn't have grouping. Third party controls like the Telerik Grid have this functionality.

Upvotes: 2

Related Questions