0
votes

In my flex datagird i have a checkbox and a datgrid with seven columns.

im populating values in first five column(remaining two column no values) of datgrid by an Arraycollection.

now,By clicking the checkbox i want to show all seven column values and if i uncheck five columns has to show... how its possible?? any idea?

heres my code

<mx:DataGrid x="33" y="176" width="952" height="334">
    <mx:columns>
        <mx:DataGridColumn headerText="one" dataField="one"/>
        <mx:DataGridColumn headerText="two" dataField="two"/>
        <mx:DataGridColumn headerText="three" dataField="three"/>
        <mx:DataGridColumn headerText="four" dataField="four"/>
        <mx:DataGridColumn headerText="five" dataField="five"/>
        <mx:DataGridColumn headerText="six" dataField="six"/>
        <mx:DataGridColumn headerText="seven" dataField="seven"/></mx:Datagrid> <mx:Checkbox/>

Suggest me some idea...Thankxx in advance...

1

1 Answers

2
votes

Try this, You populate all the fields but only control with visibility of columns:

<s:CheckBox id="chkShowGridAllFields" label="Show All Details"  />

and in your grid columns:

<mx:DataGridColumn headerText="six" dataField="six" 
    visible="{chkShowGridAllFields.selected}" width="200" />
<mx:DataGridColumn headerText="seven" dataField="seven" 
    visible="{chkShowGridAllFields.selected}" width="200" />