tags:

views:

29

answers:

3

How can I have one tile for two columns in a Flex datagrid, like the example "Identification"

alt text

+2  A: 

I don't think this is doable in DataGrid. I use AdvancedDataGrid with groupedColumns, as in this Adobe example:

  <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>
Robusto
A: 

Is there a particular reason that it needs to be 2 fields in the grid? You could add a property to the object you're displaying in the grid that would concatenate the 2 fields in question. Or you could just set the header text of one of the 2 fields to blank "".

mezmo
+1  A: 

I figured out a method for getting this to work (and blogged about it http://flexoop.com/2009/03/adding-colspan-to-a-datagrid/). It all comes down to a datagrid within a datagrid. Works pretty nicely.

Gareth Arch