tags:

views:

1720

answers:

2

I am looking into achieving below two features in a flex grid( or advanced grid).

1. merge column headers ( as in group just the cells in the header row ).
2. add multiple ( say 2 ) headers to the grid.

If you know any such examples pls help me with some link.

thanks.

(I am using flex 3)

+1  A: 

here is an example of column grouping

<?xml version="1.0"?>
<!-- dpcontrols/adg/ColumnGroupADG.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"&gt;

    <mx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;

            // Import the data used by the AdvancedDataGrid control. 
            include "SimpleFlatData.as";
        ]]>
    </mx:Script>

    <mx:AdvancedDataGrid id="myADG"
        dataProvider="{dpFlat}"
        width="100%" height="100%">
        <mx:groupedColumns>
            <mx:AdvancedDataGridColumn dataField="Region"/>
            <mx:AdvancedDataGridColumn dataField="Territory"/>
            <mx:AdvancedDataGridColumn dataField="Territory_Rep"
                headerText="Territory Rep"/>
            <mx:AdvancedDataGridColumnGroup headerText="Revenues">    
                <mx:AdvancedDataGridColumn dataField="Actual"/>
                <mx:AdvancedDataGridColumn dataField="Estimate"/>
            </mx:AdvancedDataGridColumnGroup>    
        </mx:groupedColumns>
   </mx:AdvancedDataGrid>
</mx:Application>

link http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_09.html

Rahul Garg
actually I want to merge cells not grouping.Merge cells as in - we can do in html by using rowspan.
dotnetcoder
+3  A: 

Found this link that exactly does what I want :)

http://blogs.adobe.com/aharui/2007/03/thinking_about_item_renderers_1.html see section: Split Columns/Grouped Columns

dotnetcoder