As I recall, if your dataProvider is a clean array of simple objects, the DataGrid will default to displaying all the columns, with the property names as column headers, and in unpredictable order.

 

Alternatively, you can dynamically create the DG columns.  To do this you will need some kind of “metadata” to define the column properties.  Dynamically created DGs are noticeably slower to render, but not unbearably so.

 

Tracy

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of t_msreddy
Sent: Monday, January 09, 2006 5:59 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] dynamic number of datagrid columns

 

HiI need to implement a datagrid based on user input. User input determines the number of datagrid columns.Can you please tell me how to do this? In all the examples I have seen the grid columns are static though data is rendered through data provider like this:<mxataGrid id="datagrid1" width="100%" height="80%" dataProvider="{dp}"  rowHeight="100">      <mx:columns>        <mx:Array>          <mxataGridColumn headerText="Name" columnName="name" editable="false"/>          <mxataGridColumn headerText="City" columnName="city" editable="false" />           <mxataGridColumn headerText="Birthday"  cellRenderer="GridCellRenderer"  />             <mxataGridColumn headerText="Favorites" columnName="combodata" editable="true"  />             <mxataGridColumn headerText="Delete"  columnName="candelete" editable="true"  />        </mx:Array>      </mx:columns>                </mxataGrid>
 
here you have mxataGridColumn  tags which render the columns. I need to implement a datagrid which has dynamic number of 
columns.
 
Please help me.




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to