UltraWebGrid + TypedView + Groups

Posts   
 
    
mattsmith321 avatar
Posts: 146
Joined: 04-Oct-2004
# Posted on: 27-Mar-2006 21:53:36   

Hi all!

I've been working with LLBL for a while but am now in a new situation where I need to work with TypedViews and the Infragistics UltraWebGrid. I'm having a problem getting the grid to do the grouping the way I want.

TypedView: - Project - Category - ChargeCode - ChargeDesc

I want to output it similar to the following: +Project A +-- Category X +-- -- 111111: Description of 111111 +-- -- 333333: Description of 333333 +-- -- 555555: Description of 555555 +-- Category Y +-- -- 222222: Description of 222222 +-- -- 444444: Description of 444444 +-- -- 666666: Description of 666666 +Project B +-- Category J +-- -- 121212: Description of 121212 +-- -- 343434: Description of 343434 +-- -- 565656: Description of 565656 +-- Category K +-- -- 232323: Description of 232323 +-- -- 454545: Description of 454545 +-- -- 676767: Description of 676767 Basically it ends up being pretty similar to an unordered list, but I want it in a table and need to use UltraWebGrid.

I'm new to Infragistics and UltraWebGrid (and giving up HTML control in general) but I can't figure out what properties I need to set and at what level (UltraWebGrid, Bands, DisplayLayout, etc.).

Any help is appreciated!

Thanks, Matt

BertS
User
Posts: 89
Joined: 28-Jul-2005
# Posted on: 27-Mar-2006 23:58:16   

Hi Math,

Define a single band in the grid with the four fields. Then when loading data into the grid, add the two first columns to the ultragrid.displaylayout.bands(0).sortedcolumns-collection (or something like that, anyway it's the sordercolumns-collection). When adding, you can set a parameter to true to say that the band must be grouped by that column. Then perform a groupby in the grid.

You can look in the help to find some samples for that. It's just like binding a single-table dataset or a datatable. Some links that may be useful: http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=1026 http://help.infragistics.com/NetAdvantage/2006.1/CLR1.x/HelpFiles/20061/WebGrid_How_to_Use_the_ViewType_Property.html

mattsmith321 avatar
Posts: 146
Joined: 04-Oct-2004
# Posted on: 28-Mar-2006 19:48:55   

Thanks. I had seen one of those links before but didn't try the code since I assumed that there was a way to do it via properties on the grid control in design view. I tried it with the code and it does what I want.

BertS
User
Posts: 89
Joined: 28-Jul-2005
# Posted on: 30-Mar-2006 00:14:34   

Setting GroupBy via UI isn't the best part of Infragistics. In Winforms it's possible to do it through showing the Outlook-Groupbox and then drag/drop the columsn to group (and then hide the groupbox). I'm not sure if this is possible in Webforms...