<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Dynamically adding new columns to a DataGrid control in Flex</title>
	<atom:link href="http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Thu, 18 Mar 2010 14:05:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/comment-page-1/#comment-6688</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Sun, 27 Dec 2009 19:13:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/#comment-6688</guid>
		<description>@charlie crystle,

In Flex you add data to the data provider (ArrayCollection, etc), not to the control itself.

Peter</description>
		<content:encoded><![CDATA[<p>@charlie crystle,</p>
<p>In Flex you add data to the data provider (ArrayCollection, etc), not to the control itself.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: charlie crystle</title>
		<link>http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/comment-page-1/#comment-6687</link>
		<dc:creator>charlie crystle</dc:creator>
		<pubDate>Sun, 27 Dec 2009 19:10:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/#comment-6687</guid>
		<description>peter--sorry if this is a stupid question...

but why isn&#039;t there an explicit method for adding rows to the datagrid? something like dg.AddRow(myObject.name, myObject.job....)

the flex datagrid is different from the flash datagrid...

http://www.adobe.com/devnet/flash/quickstart/datagrid_pt1/</description>
		<content:encoded><![CDATA[<p>peter&#8211;sorry if this is a stupid question&#8230;</p>
<p>but why isn&#8217;t there an explicit method for adding rows to the datagrid? something like dg.AddRow(myObject.name, myObject.job&#8230;.)</p>
<p>the flex datagrid is different from the flash datagrid&#8230;</p>
<p><a href="http://www.adobe.com/devnet/flash/quickstart/datagrid_pt1/" rel="nofollow">http://www.adobe.com/devnet/flash/quickstart/datagrid_pt1/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: charlie crystle</title>
		<link>http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/comment-page-1/#comment-6686</link>
		<dc:creator>charlie crystle</dc:creator>
		<pubDate>Sun, 27 Dec 2009 18:04:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/#comment-6686</guid>
		<description>Peter--thanks for this. Not the post itself, but your generosity in the comments.  I have found the documentation and samples from Adobe not very well articulated through code samples. The reliance on MXML is just so over the top; MXML is great except when you need flexibility. You should be able to program everything (and you can), but the examples are just not that great. 

The more emphasis you put on AS3 examples the better. MXML is handy, but for flexibility, AS3 is much more useful and powerful.</description>
		<content:encoded><![CDATA[<p>Peter&#8211;thanks for this. Not the post itself, but your generosity in the comments.  I have found the documentation and samples from Adobe not very well articulated through code samples. The reliance on MXML is just so over the top; MXML is great except when you need flexibility. You should be able to program everything (and you can), but the examples are just not that great. </p>
<p>The more emphasis you put on AS3 examples the better. MXML is handy, but for flexibility, AS3 is much more useful and powerful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dinesh Kumar D</title>
		<link>http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/comment-page-1/#comment-6494</link>
		<dc:creator>Dinesh Kumar D</dc:creator>
		<pubDate>Tue, 01 Dec 2009 08:17:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/#comment-6494</guid>
		<description>After i have added or removed the columns from the datagrid, the contents in the datagrid seems to disappear. I have tried assigning the Arraycollection to the dataprovider property of datagrid.. But still i dont see any contents.. could you tell me why?</description>
		<content:encoded><![CDATA[<p>After i have added or removed the columns from the datagrid, the contents in the datagrid seems to disappear. I have tried assigning the Arraycollection to the dataprovider property of datagrid.. But still i dont see any contents.. could you tell me why?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/comment-page-1/#comment-6478</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Fri, 27 Nov 2009 03:20:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/#comment-6478</guid>
		<description>@Dinesh Kumar D,

The DataGrid control&#039;s &lt;code&gt;columns&lt;/code&gt; is just an Array, so you can use array methods to remove columns. For example, the following code removes the first column (using the &lt;code&gt;splice()&lt;/code&gt; method) each time you click the button:
&lt;pre lang=&quot;mxml&quot;&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;&gt;
    
    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function removeColumnAtIndex(idx:uint):void {
                var cols:Array = dataGrid.columns;
                cols.splice(idx, 1);
                dataGrid.columns = cols;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock=&quot;true&quot;&gt;
        &lt;mx:Button label=&quot;Remove column 0&quot; click=&quot;removeColumnAtIndex(0);&quot; /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:DataGrid id=&quot;dataGrid&quot;
                 width=&quot;400&quot;
                 rowCount=&quot;6&quot;&gt;
        &lt;mx:columns&gt;
            &lt;mx:DataGridColumn dataField=&quot;col1&quot; /&gt;
            &lt;mx:DataGridColumn dataField=&quot;col2&quot; /&gt;
            &lt;mx:DataGridColumn dataField=&quot;col3&quot; /&gt;
            &lt;mx:DataGridColumn dataField=&quot;col4&quot; /&gt;
        &lt;/mx:columns&gt;
        &lt;mx:dataProvider&gt;
            &lt;mx:ArrayCollection&gt;
                &lt;mx:source&gt;
                    &lt;mx:Array&gt;
                        &lt;mx:Object col1=&quot;A.1&quot; col2=&quot;A.2&quot; col3=&quot;A.3&quot; col4=&quot;A.4&quot;/&gt;
                        &lt;mx:Object col1=&quot;B.1&quot; col2=&quot;B.2&quot; col3=&quot;B.3&quot; col4=&quot;B.4&quot;/&gt;
                        &lt;mx:Object col1=&quot;C.1&quot; col2=&quot;C.2&quot; col3=&quot;C.3&quot; col4=&quot;C.4&quot;/&gt;
                        &lt;mx:Object col1=&quot;D.1&quot; col2=&quot;D.2&quot; col3=&quot;D.3&quot; col4=&quot;D.4&quot;/&gt;
                        &lt;mx:Object col1=&quot;E.1&quot; col2=&quot;E.2&quot; col3=&quot;E.3&quot; col4=&quot;E.4&quot;/&gt;
                        &lt;mx:Object col1=&quot;F.1&quot; col2=&quot;F.2&quot; col3=&quot;F.3&quot; col4=&quot;F.4&quot;/&gt;
                    &lt;/mx:Array&gt;
                &lt;/mx:source&gt;
            &lt;/mx:ArrayCollection&gt;
        &lt;/mx:dataProvider&gt;
    &lt;/mx:DataGrid&gt;
    
&lt;/mx:Application&gt;
&lt;/pre&gt;

Also, in my previous comment I showed how you can toggle a DataGridColumn&#039;s visibility by setting the Boolean &lt;code&gt;visible&lt;/code&gt; property.

Peter</description>
		<content:encoded><![CDATA[<p>@Dinesh Kumar D,</p>
<p>The DataGrid control&#8217;s <code>columns</code> is just an Array, so you can use array methods to remove columns. For example, the following code removes the first column (using the <code>splice()</code> method) each time you click the button:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            private function removeColumnAtIndex(idx:uint):void {</span>
<span style="color: #339933;">                var cols:Array = dataGrid.columns;</span>
<span style="color: #339933;">                cols.splice(idx, 1);</span>
<span style="color: #339933;">                dataGrid.columns = cols;</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> dock=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;Remove column 0&quot;</span> click=<span style="color: #ff0000;">&quot;removeColumnAtIndex(0);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGrid</span> id=<span style="color: #ff0000;">&quot;dataGrid&quot;</span></span>
<span style="color: #000000;">                 width=<span style="color: #ff0000;">&quot;400&quot;</span></span>
<span style="color: #000000;">                 rowCount=<span style="color: #ff0000;">&quot;6&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;col1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;col2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;col3&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;col4&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ArrayCollection</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:source</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Array</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> col1=<span style="color: #ff0000;">&quot;A.1&quot;</span> col2=<span style="color: #ff0000;">&quot;A.2&quot;</span> col3=<span style="color: #ff0000;">&quot;A.3&quot;</span> col4=<span style="color: #ff0000;">&quot;A.4&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> col1=<span style="color: #ff0000;">&quot;B.1&quot;</span> col2=<span style="color: #ff0000;">&quot;B.2&quot;</span> col3=<span style="color: #ff0000;">&quot;B.3&quot;</span> col4=<span style="color: #ff0000;">&quot;B.4&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> col1=<span style="color: #ff0000;">&quot;C.1&quot;</span> col2=<span style="color: #ff0000;">&quot;C.2&quot;</span> col3=<span style="color: #ff0000;">&quot;C.3&quot;</span> col4=<span style="color: #ff0000;">&quot;C.4&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> col1=<span style="color: #ff0000;">&quot;D.1&quot;</span> col2=<span style="color: #ff0000;">&quot;D.2&quot;</span> col3=<span style="color: #ff0000;">&quot;D.3&quot;</span> col4=<span style="color: #ff0000;">&quot;D.4&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> col1=<span style="color: #ff0000;">&quot;E.1&quot;</span> col2=<span style="color: #ff0000;">&quot;E.2&quot;</span> col3=<span style="color: #ff0000;">&quot;E.3&quot;</span> col4=<span style="color: #ff0000;">&quot;E.4&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> col1=<span style="color: #ff0000;">&quot;F.1&quot;</span> col2=<span style="color: #ff0000;">&quot;F.2&quot;</span> col3=<span style="color: #ff0000;">&quot;F.3&quot;</span> col4=<span style="color: #ff0000;">&quot;F.4&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Array</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:source</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ArrayCollection</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:DataGrid</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Also, in my previous comment I showed how you can toggle a DataGridColumn&#8217;s visibility by setting the Boolean <code>visible</code> property.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dinesh Kumar D</title>
		<link>http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/comment-page-1/#comment-6460</link>
		<dc:creator>Dinesh Kumar D</dc:creator>
		<pubDate>Thu, 26 Nov 2009 06:24:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/#comment-6460</guid>
		<description>Hi,

i need to dynamically remove columns from the table.. how can this be done?</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>i need to dynamically remove columns from the table.. how can this be done?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/comment-page-1/#comment-5933</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Mon, 05 Oct 2009 18:11:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/#comment-5933</guid>
		<description>@Anonymous,

You can set the &lt;code&gt;visible&lt;/code&gt; property on each DataGridColumn object, as seen in the following example:
&lt;pre lang=&quot;mxml&quot;&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;&gt;

    &lt;mx:ArrayCollection id=&quot;arrColl&quot;&gt;
        &lt;mx:source&gt;
            &lt;mx:Object c1=&quot;1.One&quot; c2=&quot;1.Two&quot; c3=&quot;1.Three&quot; /&gt;
            &lt;mx:Object c1=&quot;2.One&quot; c2=&quot;2.Two&quot; c3=&quot;2.Three&quot; /&gt;
            &lt;mx:Object c1=&quot;3.One&quot; c2=&quot;3.Two&quot; c3=&quot;3.Three&quot; /&gt;
            &lt;mx:Object c1=&quot;4.One&quot; c2=&quot;4.Two&quot; c3=&quot;4.Three&quot; /&gt;
            &lt;mx:Object c1=&quot;5.One&quot; c2=&quot;5.Two&quot; c3=&quot;5.Three&quot; /&gt;
            &lt;mx:Object c1=&quot;6.One&quot; c2=&quot;6.Two&quot; c3=&quot;6.Three&quot; /&gt;
            &lt;mx:Object c1=&quot;7.One&quot; c2=&quot;7.Two&quot; c3=&quot;7.Three&quot; /&gt;
            &lt;mx:Object c1=&quot;8.One&quot; c2=&quot;8.Two&quot; c3=&quot;8.Three&quot; /&gt;
            &lt;mx:Object c1=&quot;9.One&quot; c2=&quot;9.Two&quot; c3=&quot;9.Three&quot; /&gt;
        &lt;/mx:source&gt;
    &lt;/mx:ArrayCollection&gt;

    &lt;mx:ApplicationControlBar dock=&quot;true&quot;&gt;
        &lt;mx:Button id=&quot;btn1&quot; label=&quot;Column 1&quot; toggle=&quot;true&quot; selected=&quot;true&quot; /&gt;
        &lt;mx:Button id=&quot;btn2&quot; label=&quot;Column 2&quot; toggle=&quot;true&quot; selected=&quot;true&quot; /&gt;
        &lt;mx:Button id=&quot;btn3&quot; label=&quot;Column 3&quot; toggle=&quot;true&quot; selected=&quot;true&quot; /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:DataGrid id=&quot;dataGrid&quot; dataProvider=&quot;{arrColl}&quot; width=&quot;300&quot; rowCount=&quot;5&quot;&gt;
        &lt;mx:columns&gt;
            &lt;mx:DataGridColumn dataField=&quot;c1&quot; visible=&quot;{btn1.selected}&quot; /&gt;
            &lt;mx:DataGridColumn dataField=&quot;c2&quot; visible=&quot;{btn2.selected}&quot; /&gt;
            &lt;mx:DataGridColumn dataField=&quot;c3&quot; visible=&quot;{btn3.selected}&quot; /&gt;
        &lt;/mx:columns&gt;
    &lt;/mx:DataGrid&gt;

&lt;/mx:Application&gt;
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p>@Anonymous,</p>
<p>You can set the <code>visible</code> property on each DataGridColumn object, as seen in the following example:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ArrayCollection</span> id=<span style="color: #ff0000;">&quot;arrColl&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:source</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;1.One&quot;</span> c2=<span style="color: #ff0000;">&quot;1.Two&quot;</span> c3=<span style="color: #ff0000;">&quot;1.Three&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;2.One&quot;</span> c2=<span style="color: #ff0000;">&quot;2.Two&quot;</span> c3=<span style="color: #ff0000;">&quot;2.Three&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;3.One&quot;</span> c2=<span style="color: #ff0000;">&quot;3.Two&quot;</span> c3=<span style="color: #ff0000;">&quot;3.Three&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;4.One&quot;</span> c2=<span style="color: #ff0000;">&quot;4.Two&quot;</span> c3=<span style="color: #ff0000;">&quot;4.Three&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;5.One&quot;</span> c2=<span style="color: #ff0000;">&quot;5.Two&quot;</span> c3=<span style="color: #ff0000;">&quot;5.Three&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;6.One&quot;</span> c2=<span style="color: #ff0000;">&quot;6.Two&quot;</span> c3=<span style="color: #ff0000;">&quot;6.Three&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;7.One&quot;</span> c2=<span style="color: #ff0000;">&quot;7.Two&quot;</span> c3=<span style="color: #ff0000;">&quot;7.Three&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;8.One&quot;</span> c2=<span style="color: #ff0000;">&quot;8.Two&quot;</span> c3=<span style="color: #ff0000;">&quot;8.Three&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> c1=<span style="color: #ff0000;">&quot;9.One&quot;</span> c2=<span style="color: #ff0000;">&quot;9.Two&quot;</span> c3=<span style="color: #ff0000;">&quot;9.Three&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:source</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ArrayCollection</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> dock=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> id=<span style="color: #ff0000;">&quot;btn1&quot;</span> label=<span style="color: #ff0000;">&quot;Column 1&quot;</span> toggle=<span style="color: #ff0000;">&quot;true&quot;</span> selected=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> id=<span style="color: #ff0000;">&quot;btn2&quot;</span> label=<span style="color: #ff0000;">&quot;Column 2&quot;</span> toggle=<span style="color: #ff0000;">&quot;true&quot;</span> selected=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> id=<span style="color: #ff0000;">&quot;btn3&quot;</span> label=<span style="color: #ff0000;">&quot;Column 3&quot;</span> toggle=<span style="color: #ff0000;">&quot;true&quot;</span> selected=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGrid</span> id=<span style="color: #ff0000;">&quot;dataGrid&quot;</span> dataProvider=<span style="color: #ff0000;">&quot;{arrColl}&quot;</span> width=<span style="color: #ff0000;">&quot;300&quot;</span> rowCount=<span style="color: #ff0000;">&quot;5&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;c1&quot;</span> visible=<span style="color: #ff0000;">&quot;{btn1.selected}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;c2&quot;</span> visible=<span style="color: #ff0000;">&quot;{btn2.selected}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;c3&quot;</span> visible=<span style="color: #ff0000;">&quot;{btn3.selected}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:DataGrid</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/comment-page-1/#comment-5932</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Mon, 05 Oct 2009 17:43:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/#comment-5932</guid>
		<description>Hi,

I am novice in programation and flexo solutions, so I want to hide and unhide a column depending on some dynamic variable.

for example if the user select a check, it automatically show one specific column and if the user uncheck, that column is hide.

thanks
GAP</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I am novice in programation and flexo solutions, so I want to hide and unhide a column depending on some dynamic variable.</p>
<p>for example if the user select a check, it automatically show one specific column and if the user uncheck, that column is hide.</p>
<p>thanks<br />
GAP</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bhuvan</title>
		<link>http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/comment-page-1/#comment-2716</link>
		<dc:creator>Bhuvan</dc:creator>
		<pubDate>Mon, 30 Mar 2009 16:07:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/#comment-2716</guid>
		<description>Hello ,

Could you tell me.. that getting a label from datagrid..

i&#039;m breifly explain...

i had a two datagrid

first one is draging the image and put into datagrid by [img.name) to imgholder arraycollection

second one  i have a check a arraycollection of same field of names in array..


first one has randomly pick the image and send it the datagrid.. like [one,three,two..)

i want to compare the data from  the arraycollection to  imgholder .....

if rowcol value of label is equal to the imgholder... if its same mean the  list the label is equal.... else its unequal array.....


here, i can&#039;t make to compare the two datagrid....
could give a code or explain to get....

my code...








































Thanks &amp; Regrads
BHUVAN</description>
		<content:encoded><![CDATA[<p>Hello ,</p>
<p>Could you tell me.. that getting a label from datagrid..</p>
<p>i&#8217;m breifly explain&#8230;</p>
<p>i had a two datagrid</p>
<p>first one is draging the image and put into datagrid by [img.name) to imgholder arraycollection</p>
<p>second one  i have a check a arraycollection of same field of names in array..</p>
<p>first one has randomly pick the image and send it the datagrid.. like [one,three,two..)</p>
<p>i want to compare the data from  the arraycollection to  imgholder &#8230;..</p>
<p>if rowcol value of label is equal to the imgholder&#8230; if its same mean the  list the label is equal&#8230;. else its unequal array&#8230;..</p>
<p>here, i can&#8217;t make to compare the two datagrid&#8230;.<br />
could give a code or explain to get&#8230;.</p>
<p>my code&#8230;</p>
<p>Thanks &amp; Regrads<br />
BHUVAN</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan</title>
		<link>http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/comment-page-1/#comment-2717</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Thu, 26 Mar 2009 14:13:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/04/dynamically-adding-new-columns-to-a-datagrid-control-in-flex/#comment-2717</guid>
		<description>Hey, I have been looking at the example that you provided for adding dynamic columns to a datagrid that is coming back off an httpService.

I have a similar issue that I was hoping someone can help with. I currently am getting xml from php (which works fine) but the xml returned is multidimensional and I need to dynamically create a datagrid to handle the xml returned. The structure being returned is as follows:

&lt;section&gt;
    &lt;user&gt; (can be mulitple users)
        &lt;firstname&gt;
        &lt;lastname&gt;
            &lt;document&gt; (will be mutiple)
                &lt;submissiondate&gt;
            &lt;/document&gt;
     &lt;/user&gt;
&lt;/section&gt;

I am trying to get the data returned into a datagrid to display the section,firstname,lastname,and document as the column headers.

Thanks!</description>
		<content:encoded><![CDATA[<p>Hey, I have been looking at the example that you provided for adding dynamic columns to a datagrid that is coming back off an httpService.</p>
<p>I have a similar issue that I was hoping someone can help with. I currently am getting xml from php (which works fine) but the xml returned is multidimensional and I need to dynamically create a datagrid to handle the xml returned. The structure being returned is as follows:</p>
<p>&lt;section&gt;<br />
    &lt;user&gt; (can be mulitple users)<br />
        &lt;firstname&gt;<br />
        &lt;lastname&gt;<br />
            &lt;document&gt; (will be mutiple)<br />
                &lt;submissiondate&gt;<br />
            &lt;/document&gt;<br />
     &lt;/user&gt;<br />
&lt;/section&gt;</p>
<p>I am trying to get the data returned into a datagrid to display the section,firstname,lastname,and document as the column headers.</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
