<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex Examples &#187; DataGrid</title>
	<atom:link href="http://blog.flexexamples.com/category/halo/datagrid/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating complex data provider objects in MXML using Flex 4</title>
		<link>http://blog.flexexamples.com/2010/10/20/creating-complex-data-provider-objects-in-mxml-using-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/10/20/creating-complex-data-provider-objects-in-mxml-using-flex-4/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 21:04:48 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[DataGridColumn]]></category>
		<category><![CDATA[Flex4]]></category>
		<category><![CDATA[dataProvider]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=3371</guid>
		<description><![CDATA[<p>The following example shows how you can create a complex MX DataGrid data provider with nested objects in MXML using the &#60;fx:Object&#62; tag.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/10/20/creating-complex-data-provider-objects-in-mxml-using-flex-4/ --&#62; &#60;s:Application name=&#34;MX_DataGrid_dataProvider_Object_test&#34; xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34; xmlns:mx=&#34;library://ns.adobe.com/flex/mx&#34;&#62; &#160; &#60;mx:DataGrid id=&#34;dg&#34; horizontalCenter=&#34;0&#34; verticalCenter=&#34;0&#34;&#62; &#60;mx:columns&#62; &#60;mx:DataGridColumn dataField=&#34;firstName&#34; /&#62; &#60;mx:DataGridColumn dataField=&#34;lastName&#34; /&#62; &#60;mx:DataGridColumn dataField=&#34;address.town&#34; /&#62; &#60;mx:DataGridColumn dataField=&#34;address.state&#34; /&#62; &#60;mx:DataGridColumn dataField=&#34;address.zipCode&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can create a complex MX DataGrid data provider with nested objects in MXML using the &lt;fx:Object&gt; tag.</p>
<p><span id="more-3371"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/10/20/creating-complex-data-provider-objects-in-mxml-using-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;MX_DataGrid_dataProvider_Object_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</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;dg&quot;</span> horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&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;firstName&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;lastName&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;address.town&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;address.state&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;address.zipCode&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;fx:Object</span> firstName=<span style="color: #ff0000;">&quot;Carol&quot;</span> lastName=<span style="color: #ff0000;">&quot;F.&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:address</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> town=<span style="color: #ff0000;">&quot;Waltham&quot;</span> state=<span style="color: #ff0000;">&quot;MA&quot;</span> zipCode=<span style="color: #ff0000;">&quot;02452&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:address</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Object</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> firstName=<span style="color: #ff0000;">&quot;Darrell&quot;</span> lastName=<span style="color: #ff0000;">&quot;L.&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:address</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> town=<span style="color: #ff0000;">&quot;Waltham&quot;</span> state=<span style="color: #ff0000;">&quot;MA&quot;</span> zipCode=<span style="color: #ff0000;">&quot;02452&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:address</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Object</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> firstName=<span style="color: #ff0000;">&quot;Hans&quot;</span> lastName=<span style="color: #ff0000;">&quot;M.&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:address</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> town=<span style="color: #ff0000;">&quot;San Francisco&quot;</span> state=<span style="color: #ff0000;">&quot;CA&quot;</span> zipCode=<span style="color: #ff0000;">&quot;94103&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:address</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Object</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> firstName=<span style="color: #ff0000;">&quot;Kevin&quot;</span> lastName=<span style="color: #ff0000;">&quot;L.&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:address</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> town=<span style="color: #ff0000;">&quot;San Francisco&quot;</span> state=<span style="color: #ff0000;">&quot;CA&quot;</span> zipCode=<span style="color: #ff0000;">&quot;94103&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:address</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Object</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;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Or you can also create the nested object&#8217;s using ActionScript, 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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/10/20/creating-complex-data-provider-objects-in-mxml-using-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;MX_DataGrid_dataProvider_Object_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span></span>
<span style="color: #000000;">        initialize=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import mx.collections.ArrayCollection;</span>
<span style="color: #000000;">            import mx.controls.DataGrid;</span>
<span style="color: #000000;">            import mx.controls.dataGridClasses.DataGridColumn;</span>
&nbsp;
<span style="color: #000000;">            protected var dg:DataGrid;</span>
&nbsp;
<span style="color: #000000;">            protected function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var cols:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">                cols.push<span style="color: #66cc66;">&#40;</span>new DataGridColumn<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;firstName&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                cols.push<span style="color: #66cc66;">&#40;</span>new DataGridColumn<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;lastName&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                cols.push<span style="color: #66cc66;">&#40;</span>new DataGridColumn<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;address.town&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                cols.push<span style="color: #66cc66;">&#40;</span>new DataGridColumn<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;address.state&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                cols.push<span style="color: #66cc66;">&#40;</span>new DataGridColumn<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;address.zipCode&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var arr:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">                arr.push<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>firstName:<span style="color: #ff0000;">&quot;Carol&quot;</span>, lastName:<span style="color: #ff0000;">&quot;F.&quot;</span>, address:<span style="color: #66cc66;">&#123;</span>town:<span style="color: #ff0000;">&quot;Waltham&quot;</span>, state:<span style="color: #ff0000;">&quot;MA&quot;</span>, zipCode:<span style="color: #ff0000;">&quot;02452&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                arr.push<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>firstName:<span style="color: #ff0000;">&quot;Darrell&quot;</span>, lastName:<span style="color: #ff0000;">&quot;L.&quot;</span>, address:<span style="color: #66cc66;">&#123;</span>town:<span style="color: #ff0000;">&quot;Waltham&quot;</span>, state:<span style="color: #ff0000;">&quot;MA&quot;</span>, zipCode:<span style="color: #ff0000;">&quot;02452&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                arr.push<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>firstName:<span style="color: #ff0000;">&quot;Hans&quot;</span>, lastName:<span style="color: #ff0000;">&quot;M.&quot;</span>, address:<span style="color: #66cc66;">&#123;</span>town:<span style="color: #ff0000;">&quot;San Francisco&quot;</span>, state:<span style="color: #ff0000;">&quot;CA&quot;</span>, zipCode:<span style="color: #ff0000;">&quot;94103&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                arr.push<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>firstName:<span style="color: #ff0000;">&quot;Kevin&quot;</span>, lastName:<span style="color: #ff0000;">&quot;L.&quot;</span>, address:<span style="color: #66cc66;">&#123;</span>town:<span style="color: #ff0000;">&quot;San Francisco&quot;</span>, state:<span style="color: #ff0000;">&quot;CA&quot;</span>, zipCode:<span style="color: #ff0000;">&quot;94103&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                dg = new DataGrid<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dg.columns = cols;</span>
<span style="color: #000000;">                dg.dataProvider = new ArrayCollection<span style="color: #66cc66;">&#40;</span>arr<span style="color: #66cc66;">&#41;</span>;;</span>
<span style="color: #000000;">                dg.horizontalCenter = dg.verticalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                addElement<span style="color: #66cc66;">&#40;</span>dg<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>You can also define the nested object inline in your MXML by using two &#8220;{&#8221; chars instead of 1, as seen in the following example (where the first/outer &#8220;{&#8221; denotes data binding and the second/inner &#8220;{&#8221; denotes new Object() shorthand):</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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/10/20/creating-complex-data-provider-objects-in-mxml-using-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;MX_DataGrid_dataProvider_Object_test&quot;</span></span>
<span style="color: #000000;">               xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">               xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">               xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</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;dg&quot;</span> horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&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;firstName&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;lastName&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;address.town&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;address.state&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;address.zipCode&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;fx:Object</span> firstName=<span style="color: #ff0000;">&quot;Carol&quot;</span> lastName=<span style="color: #ff0000;">&quot;F.&quot;</span> address=<span style="color: #ff0000;">&quot;{{town:'Waltham', state:'MA', zipCode:'02452'}}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> firstName=<span style="color: #ff0000;">&quot;Darrell&quot;</span> lastName=<span style="color: #ff0000;">&quot;L.&quot;</span> address=<span style="color: #ff0000;">&quot;{{town:'Waltham', state:'MA', zipCode:'02452'}}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> firstName=<span style="color: #ff0000;">&quot;Hans&quot;</span> lastName=<span style="color: #ff0000;">&quot;M.&quot;</span> address=<span style="color: #ff0000;">&quot;{{town:'San Francisco', state:'CA', zipCode:'94103'}}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> firstName=<span style="color: #ff0000;">&quot;Kevin&quot;</span> lastName=<span style="color: #ff0000;">&quot;L.&quot;</span> address=<span style="color: #ff0000;">&quot;{{town:'San Francisco', state:'CA', zipCode:'94103'}}&quot;</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;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Creating complex data provider objects in MXML using Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/10/20/creating-complex-data-provider-objects-in-mxml-using-flex-4/',contentID: 'post-3371',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'dataProvider',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2010/10/20/creating-complex-data-provider-objects-in-mxml-using-flex-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Removing the header indicator and selection indicator from the MX DataGrid control header in Flex 3</title>
		<link>http://blog.flexexamples.com/2010/06/19/removing-the-header-indicator-and-selection-indicator-from-the-mx-datagrid-control-header-in-flex-3/</link>
		<comments>http://blog.flexexamples.com/2010/06/19/removing-the-header-indicator-and-selection-indicator-from-the-mx-datagrid-control-header-in-flex-3/#comments</comments>
		<pubDate>Sat, 19 Jun 2010 16:43:52 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[drawHeaderIndicator()]]></category>
		<category><![CDATA[drawSelectionIndicator()]]></category>
		<category><![CDATA[headerClass]]></category>
		<category><![CDATA[mx_internal]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=3174</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2010/06/18/disabling-item-highlight-indicator-in-the-mx-list-control-in-flex-3/">&#8220;Disabling item highlight indicator in the MX List control in Flex 3&#8243;</a>, we saw how you could disable the highlight indicator in the MX List control in Flex 3 by subclassing the List control and overriding the protected drawHighlightIndicator() method.</p> <p>The following example shows how you can remove the header [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2010/06/18/disabling-item-highlight-indicator-in-the-mx-list-control-in-flex-3/">&#8220;Disabling item highlight indicator in the MX List control in Flex 3&#8243;</a>, we saw how you could disable the highlight indicator in the MX List control in Flex 3 by subclassing the List control and overriding the protected <code>drawHighlightIndicator()</code> method.</p>
<p>The following example shows how you can remove the header indicator and selection indicator from the MX DataGrid control in Flex 3 by extending the DataGridHeader class, overriding the protected <code>drawHeaderIndicator()</code> and <code>drawSelectionIndicator()</code> methods and setting the <code>headerClass</code> property in the <code>mx_internal</code> namespace.</p>
<p><span id="more-3174"></span></p>
<p class="alert">Since this example uses the <strong>mx_internal</strong> namespace, you can't always depend on this behavior to work in future versions of the Flex SDK. Use at your own risk.</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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/06/19/removing-the-header-indicator-and-selection-indicator-from-the-mx-datagrid-control-header-in-flex-3/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;MX_DataGrid_headerClass_drawHeaderIndicator_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        xmlns:comps=<span style="color: #ff0000;">&quot;comps.*&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;comps:CustomDataGrid</span> id=<span style="color: #ff0000;">&quot;dGrid&quot;</span></span>
<span style="color: #000000;">            draggableColumns=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #000000;">            verticalScrollPolicy=<span style="color: #ff0000;">&quot;on&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;360&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;comps: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> headerText=<span style="color: #ff0000;">&quot;Column 1&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> headerText=<span style="color: #ff0000;">&quot;Column 2&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> headerText=<span style="color: #ff0000;">&quot;Column 3&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/comps:columns</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;comps: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:Object</span> c1=<span style="color: #ff0000;">&quot;Row 1, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 1, Column 2&quot;</span> c3=<span style="color: #ff0000;">&quot;Row 1, Column 3&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;Row 2, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 2, Column 2&quot;</span> c3=<span style="color: #ff0000;">&quot;Row 2, Column 3&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;Row 3, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 3, Column 2&quot;</span> c3=<span style="color: #ff0000;">&quot;Row 3, Column 3&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;Row 4, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 4, Column 2&quot;</span> c3=<span style="color: #ff0000;">&quot;Row 4, Column 3&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;Row 5, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 5, Column 2&quot;</span> c3=<span style="color: #ff0000;">&quot;Row 5, Column 3&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;Row 6, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 6, Column 2&quot;</span> c3=<span style="color: #ff0000;">&quot;Row 6, Column 3&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;Row 7, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 7, Column 2&quot;</span> c3=<span style="color: #ff0000;">&quot;Row 7, Column 3&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;Row 8, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 8, Column 2&quot;</span> c3=<span style="color: #ff0000;">&quot;Row 8, Column 3&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;Row 9, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 9, Column 2&quot;</span> c3=<span style="color: #ff0000;">&quot;Row 9, Column 3&quot;</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;/comps:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/comps:CustomDataGrid</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>The custom DataGrid header class, <em>comps/CustomDataGridHeader.as</em>, is as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/** http://blog.flexexamples.com/2010/06/19/removing-the-header-indicator-and-selection-indicator-from-the-mx-datagrid-control-header-in-flex-3/ */</span>
<span style="color: #9900cc; font-weight: bold;">package</span> comps <span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">Sprite</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>dataGridClasses<span style="color: #000066; font-weight: bold;">.</span>DataGridHeader<span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>listClasses<span style="color: #000066; font-weight: bold;">.</span>IListItemRenderer<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
    <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> CustomDataGridHeader <span style="color: #0033ff; font-weight: bold;">extends</span> DataGridHeader <span style="color: #000000;">&#123;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> CustomDataGridHeader<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
            <span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> drawHeaderIndicator<span style="color: #000000;">&#40;</span>indicator<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">width</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">height</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">color</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">uint</span><span style="color: #000066; font-weight: bold;">,</span> itemRenderer<span style="color: #000066; font-weight: bold;">:</span>IListItemRenderer<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
            <span style="color: #009900; font-style: italic;">// ignore</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> drawSelectionIndicator<span style="color: #000000;">&#40;</span>indicator<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">width</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">height</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">color</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">uint</span><span style="color: #000066; font-weight: bold;">,</span> itemRenderer<span style="color: #000066; font-weight: bold;">:</span>IListItemRenderer<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
            <span style="color: #009900; font-style: italic;">// ignore</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>And the custom DataGrid control, <em>comps/CustomDataGrid.as</em>, is as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/** http://blog.flexexamples.com/2010/06/19/removing-the-header-indicator-and-selection-indicator-from-the-mx-datagrid-control-header-in-flex-3/ */</span>
<span style="color: #9900cc; font-weight: bold;">package</span> comps <span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>DataGrid<span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>core<span style="color: #000066; font-weight: bold;">.</span>mx_internal<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
    <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> CustomDataGrid <span style="color: #0033ff; font-weight: bold;">extends</span> DataGrid <span style="color: #000000;">&#123;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> CustomDataGrid<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
            <span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
            mx_internal<span style="color: #000066; font-weight: bold;">::</span>headerClass = CustomDataGridHeader<span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/MX_DataGrid_headerClass_drawHeaderIndicator_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/MX_DataGrid_headerClass_drawHeaderIndicator_test/main.html" width="100%" height="300"></iframe></p>
<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p>If you wanted to toggle the header indicator or selection indicator instead of disabling them completely, you could add two new variables to your CustomDataGrid class and add some additional logic to your custom DataGrid header class, 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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/06/19/removing-the-header-indicator-and-selection-indicator-from-the-mx-datagrid-control-header-in-flex-3/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;MX_DataGrid_headerClass_drawHeaderIndicator_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        xmlns:comps=<span style="color: #ff0000;">&quot;comps.*&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</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:Form</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;showHeaderIndicator:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:CheckBox</span> id=<span style="color: #ff0000;">&quot;ch1&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:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;showSelectionIndicator:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:CheckBox</span> id=<span style="color: #ff0000;">&quot;ch2&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:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</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;comps:CustomDataGrid</span> id=<span style="color: #ff0000;">&quot;dGrid&quot;</span></span>
<span style="color: #000000;">            draggableColumns=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #000000;">            verticalScrollPolicy=<span style="color: #ff0000;">&quot;on&quot;</span></span>
<span style="color: #000000;">            showHeaderIndicator=<span style="color: #ff0000;">&quot;{ch1.selected}&quot;</span></span>
<span style="color: #000000;">            showSelectionIndicator=<span style="color: #ff0000;">&quot;{ch2.selected}&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;360&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;comps: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> headerText=<span style="color: #ff0000;">&quot;Column 1&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> headerText=<span style="color: #ff0000;">&quot;Column 2&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> headerText=<span style="color: #ff0000;">&quot;Column 3&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/comps:columns</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;comps: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:Object</span> c1=<span style="color: #ff0000;">&quot;Row 1, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 1, Column 2&quot;</span> c3=<span style="color: #ff0000;">&quot;Row 1, Column 3&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;Row 2, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 2, Column 2&quot;</span> c3=<span style="color: #ff0000;">&quot;Row 2, Column 3&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;Row 3, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 3, Column 2&quot;</span> c3=<span style="color: #ff0000;">&quot;Row 3, Column 3&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;Row 4, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 4, Column 2&quot;</span> c3=<span style="color: #ff0000;">&quot;Row 4, Column 3&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;Row 5, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 5, Column 2&quot;</span> c3=<span style="color: #ff0000;">&quot;Row 5, Column 3&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;Row 6, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 6, Column 2&quot;</span> c3=<span style="color: #ff0000;">&quot;Row 6, Column 3&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;Row 7, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 7, Column 2&quot;</span> c3=<span style="color: #ff0000;">&quot;Row 7, Column 3&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;Row 8, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 8, Column 2&quot;</span> c3=<span style="color: #ff0000;">&quot;Row 8, Column 3&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;Row 9, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 9, Column 2&quot;</span> c3=<span style="color: #ff0000;">&quot;Row 9, Column 3&quot;</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;/comps:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/comps:CustomDataGrid</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>The custom DataGrid header class, <em>comps/CustomDataGridHeader.as</em>, is as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/** http://blog.flexexamples.com/2010/06/19/removing-the-header-indicator-and-selection-indicator-from-the-mx-datagrid-control-header-in-flex-3/ */</span>
<span style="color: #9900cc; font-weight: bold;">package</span> comps <span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">Sprite</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>dataGridClasses<span style="color: #000066; font-weight: bold;">.</span>DataGridHeader<span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>listClasses<span style="color: #000066; font-weight: bold;">.</span>IListItemRenderer<span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> comps<span style="color: #000066; font-weight: bold;">.</span>CustomDataGrid<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
    <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> CustomDataGridHeader <span style="color: #0033ff; font-weight: bold;">extends</span> DataGridHeader <span style="color: #000000;">&#123;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> CustomDataGridHeader<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
            <span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span>
        override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> drawHeaderIndicator<span style="color: #000000;">&#40;</span>indicator<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">width</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">height</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">color</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">uint</span><span style="color: #000066; font-weight: bold;">,</span> itemRenderer<span style="color: #000066; font-weight: bold;">:</span>IListItemRenderer<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
            <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>CustomDataGrid<span style="color: #000000;">&#40;</span>dataGrid<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span>showHeaderIndicator<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
                <span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000066; font-weight: bold;">.</span>drawHeaderIndicator<span style="color: #000000;">&#40;</span>indicator<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">width</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">height</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">color</span><span style="color: #000066; font-weight: bold;">,</span> itemRenderer<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> drawSelectionIndicator<span style="color: #000000;">&#40;</span>indicator<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">width</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">height</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">color</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">uint</span><span style="color: #000066; font-weight: bold;">,</span> itemRenderer<span style="color: #000066; font-weight: bold;">:</span>IListItemRenderer<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
            <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>CustomDataGrid<span style="color: #000000;">&#40;</span>dataGrid<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span>showSelectionIndicator<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
                <span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000066; font-weight: bold;">.</span>drawSelectionIndicator<span style="color: #000000;">&#40;</span>indicator<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">width</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">height</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">color</span><span style="color: #000066; font-weight: bold;">,</span> itemRenderer<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>And the custom DataGrid control, <em>comps/CustomDataGrid.as</em>, is as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/** http://blog.flexexamples.com/2010/06/19/removing-the-header-indicator-and-selection-indicator-from-the-mx-datagrid-control-header-in-flex-3/ */</span>
<span style="color: #9900cc; font-weight: bold;">package</span> comps <span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>DataGrid<span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>core<span style="color: #000066; font-weight: bold;">.</span>mx_internal<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
    <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> CustomDataGrid <span style="color: #0033ff; font-weight: bold;">extends</span> DataGrid <span style="color: #000000;">&#123;</span>
&nbsp;
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> showHeaderIndicator<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> showSelectionIndicator<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> CustomDataGrid<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
            <span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
            mx_internal<span style="color: #000066; font-weight: bold;">::</span>headerClass = CustomDataGridHeader<span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/MX_DataGrid_headerClass_drawHeaderIndicator_test2/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/MX_DataGrid_headerClass_drawHeaderIndicator_test2/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Removing the header indicator and selection indicator from the MX DataGrid control header in Flex 3 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/06/19/removing-the-header-indicator-and-selection-indicator-from-the-mx-datagrid-control-header-in-flex-3/',contentID: 'post-3174',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'drawHeaderIndicator(),drawSelectionIndicator(),headerClass,mx_internal',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2010/06/19/removing-the-header-indicator-and-selection-indicator-from-the-mx-datagrid-control-header-in-flex-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating a drop down DataGrid control in Flex 4</title>
		<link>http://blog.flexexamples.com/2010/03/09/creating-a-drop-down-datagrid-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/03/09/creating-a-drop-down-datagrid-control-in-flex-4/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 18:36:43 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta2]]></category>
		<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[PopUpAnchor (Spark)]]></category>
		<category><![CDATA[displayPopUp]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[popUpPosition]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2582</guid>
		<description><![CDATA[<p>The following example shows how you can create a drop down MX DataGrid control in Flex 4 using the Spark PopUpAnchor control in Flex 4.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/03/09/creating-a-drop-down-datagrid-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_PopUpAnchor_DataGrid_test&#34; xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34; xmlns:mx=&#34;library://ns.adobe.com/flex/mx&#34;&#62; &#60;s:layout&#62; &#60;s:VerticalLayout horizontalAlign=&#34;center&#34; paddingTop=&#34;20&#34; /&#62; &#60;/s:layout&#62; &#160; &#60;s:Group&#62; &#60;s:Button label=&#34;Pop up DataGrid&#34; click=&#34;popUpAnc.displayPopUp = !popUpAnc.displayPopUp;&#34; /&#62; &#60;s:PopUpAnchor id=&#34;popUpAnc&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can create a drop down MX DataGrid control in Flex 4 using the Spark PopUpAnchor control in Flex 4.</p>
<p><span id="more-2582"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/03/09/creating-a-drop-down-datagrid-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_PopUpAnchor_DataGrid_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VerticalLayout</span> horizontalAlign=<span style="color: #ff0000;">&quot;center&quot;</span> paddingTop=<span style="color: #ff0000;">&quot;20&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Group</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> label=<span style="color: #ff0000;">&quot;Pop up DataGrid&quot;</span></span>
<span style="color: #000000;">                click=<span style="color: #ff0000;">&quot;popUpAnc.displayPopUp = !popUpAnc.displayPopUp;&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:PopUpAnchor</span> id=<span style="color: #ff0000;">&quot;popUpAnc&quot;</span></span>
<span style="color: #000000;">                popUpPosition=<span style="color: #ff0000;">&quot;below&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</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>
                <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;s:ArrayList</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;Row 1, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 1, Column 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;Row 2, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 2, Column 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span> 
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;Row 3, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 3, Column 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span> 
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;Row 4, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 4, Column 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span> 
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;Row 5, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 5, Column 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span> 
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;Row 6, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 6, Column 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span> 
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;Row 7, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 7, Column 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span> 
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;Row 8, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 8, Column 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span> 
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;Row 9, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 9, Column 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span> 
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:ArrayList</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>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:PopUpAnchor</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Group</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/Spark_PopUpAnchor_DataGrid_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/Spark_PopUpAnchor_DataGrid_test/main.html" width="100%" height="300"></iframe></p>
<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Creating a drop down DataGrid control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/03/09/creating-a-drop-down-datagrid-control-in-flex-4/',contentID: 'post-2582',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'displayPopUp,Gumbo,popUpPosition',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2010/03/09/creating-a-drop-down-datagrid-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Removing the sort arrow skin from an MX DataGrid control in Flex</title>
		<link>http://blog.flexexamples.com/2010/02/26/removing-the-sort-arrow-skin-from-an-mx-datagrid-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2010/02/26/removing-the-sort-arrow-skin-from-an-mx-datagrid-control-in-flex/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 20:47:57 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[ProgrammaticSkin]]></category>
		<category><![CDATA[sortArrowSkin]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2530</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/02/23/changing-the-default-sort-arrow-skin-on-a-flex-datagrid-control/">&#8220;Changing the default sort arrow skin on a Flex DataGrid control&#8221;</a>, we saw how you could change the sort arrow skin on a DataGrid control in Flex by setting the sortArrowSkin style.</p> <p>The following example shows how you can remove the sort arrow skin from an MX DataGrid control in [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/02/23/changing-the-default-sort-arrow-skin-on-a-flex-datagrid-control/">&#8220;Changing the default sort arrow skin on a Flex DataGrid control&#8221;</a>, we saw how you could change the sort arrow skin on a DataGrid control in Flex by setting the <code>sortArrowSkin</code> style.</p>
<p>The following example shows how you can remove the sort arrow skin from an MX DataGrid control in Flex by setting the <code>sortArrowSkin</code> style to the mx.skins.ProgrammaticSkin class.</p>
<p><span id="more-2530"></span></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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/02/26/removing-the-sort-arrow-skin-from-an-mx-datagrid-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;DataGrid_sortArrowSkin_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</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;dGrid&quot;</span> sortArrowSkin=<span style="color: #ff0000;">&quot;mx.skins.ProgrammaticSkin&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> <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> <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> <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:Object</span> c1=<span style="color: #ff0000;">&quot;row1, col1&quot;</span> c2=<span style="color: #ff0000;">&quot;row1, col2&quot;</span> c3=<span style="color: #ff0000;">&quot;row1, col3&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;row2, col1&quot;</span> c2=<span style="color: #ff0000;">&quot;row2, col2&quot;</span> c3=<span style="color: #ff0000;">&quot;row2, col3&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;row3, col1&quot;</span> c2=<span style="color: #ff0000;">&quot;row3, col2&quot;</span> c3=<span style="color: #ff0000;">&quot;row3, col3&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;row4, col1&quot;</span> c2=<span style="color: #ff0000;">&quot;row4, col2&quot;</span> c3=<span style="color: #ff0000;">&quot;row4, col3&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;row5, col1&quot;</span> c2=<span style="color: #ff0000;">&quot;row5, col2&quot;</span> c3=<span style="color: #ff0000;">&quot;row5, col3&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;row6, col1&quot;</span> c2=<span style="color: #ff0000;">&quot;row6, col2&quot;</span> c3=<span style="color: #ff0000;">&quot;row6, col3&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;row7, col1&quot;</span> c2=<span style="color: #ff0000;">&quot;row7, col2&quot;</span> c3=<span style="color: #ff0000;">&quot;row7, col3&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;row8, col1&quot;</span> c2=<span style="color: #ff0000;">&quot;row8, col2&quot;</span> c3=<span style="color: #ff0000;">&quot;row8, col3&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;row9, col1&quot;</span> c2=<span style="color: #ff0000;">&quot;row9, col2&quot;</span> c3=<span style="color: #ff0000;">&quot;row9, col3&quot;</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 class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/DataGrid_sortArrowSkin_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/DataGrid_sortArrowSkin_test/main.html" width="100%" height="300"></iframe></p>
<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p>You can also set the <code>sortArrowSkin</code> style in an external .CSS file or &lt;Style/&gt; block, 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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/02/26/removing-the-sort-arrow-skin-from-an-mx-datagrid-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;DataGrid_sortArrowSkin_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        DataGrid {
            sortArrowSkin: ClassReference(&quot;mx.skins.ProgrammaticSkin&quot;);
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Style</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;dGrid&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> <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> <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> <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:Object</span> c1=<span style="color: #ff0000;">&quot;row1, col1&quot;</span> c2=<span style="color: #ff0000;">&quot;row1, col2&quot;</span> c3=<span style="color: #ff0000;">&quot;row1, col3&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;row2, col1&quot;</span> c2=<span style="color: #ff0000;">&quot;row2, col2&quot;</span> c3=<span style="color: #ff0000;">&quot;row2, col3&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;row3, col1&quot;</span> c2=<span style="color: #ff0000;">&quot;row3, col2&quot;</span> c3=<span style="color: #ff0000;">&quot;row3, col3&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;row4, col1&quot;</span> c2=<span style="color: #ff0000;">&quot;row4, col2&quot;</span> c3=<span style="color: #ff0000;">&quot;row4, col3&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;row5, col1&quot;</span> c2=<span style="color: #ff0000;">&quot;row5, col2&quot;</span> c3=<span style="color: #ff0000;">&quot;row5, col3&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;row6, col1&quot;</span> c2=<span style="color: #ff0000;">&quot;row6, col2&quot;</span> c3=<span style="color: #ff0000;">&quot;row6, col3&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;row7, col1&quot;</span> c2=<span style="color: #ff0000;">&quot;row7, col2&quot;</span> c3=<span style="color: #ff0000;">&quot;row7, col3&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;row8, col1&quot;</span> c2=<span style="color: #ff0000;">&quot;row8, col2&quot;</span> c3=<span style="color: #ff0000;">&quot;row8, col3&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;row9, col1&quot;</span> c2=<span style="color: #ff0000;">&quot;row9, col2&quot;</span> c3=<span style="color: #ff0000;">&quot;row9, col3&quot;</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>

<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Removing the sort arrow skin from an MX DataGrid control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/02/26/removing-the-sort-arrow-skin-from-an-mx-datagrid-control-in-flex/',contentID: 'post-2530',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'ProgrammaticSkin,sortArrowSkin',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2010/02/26/removing-the-sort-arrow-skin-from-an-mx-datagrid-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Filtering an MX DataGrid control by date range using Flex</title>
		<link>http://blog.flexexamples.com/2010/02/01/filtering-an-mx-datagrid-control-by-date-range-using-flex/</link>
		<comments>http://blog.flexexamples.com/2010/02/01/filtering-an-mx-datagrid-control-by-date-range-using-flex/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 02:11:22 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ArrayCollection]]></category>
		<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[DateField]]></category>
		<category><![CDATA[filterFunction]]></category>
		<category><![CDATA[refresh()]]></category>
		<category><![CDATA[selectableRange]]></category>
		<category><![CDATA[selectedDate]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2366</guid>
		<description><![CDATA[<p>The following example shows how you can filter an MX DataGrid control in Flex using two MX DateField control&#8217;s and filtering the ArrayCollection data provider.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/02/01/filtering-an-mx-datagrid-control-by-date-range-using-flex/ --&#62; &#60;mx:Application name=&#34;MX_DataGrid_filter_DateField_test&#34; xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;vertical&#34; verticalAlign=&#34;middle&#34; backgroundColor=&#34;white&#34; initialize=&#34;init();&#34;&#62; &#160; &#60;mx:Script&#62; &#60;![CDATA[ protected const MIN_DATE:Date = new Date(2010, 0, 1); protected const MAX_DATE:Date = new [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can filter an MX DataGrid control in Flex using two MX DateField control&#8217;s and filtering the ArrayCollection data provider.</p>
<p><span id="more-2366"></span></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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/02/01/filtering-an-mx-datagrid-control-by-date-range-using-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;MX_DataGrid_filter_DateField_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span></span>
<span style="color: #000000;">        initialize=<span style="color: #ff0000;">&quot;init();&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;">            protected const MIN_DATE:Date = new Date(2010, 0, 1);</span>
<span style="color: #339933;">            protected const MAX_DATE:Date = new Date(2010, 11, 31);</span>
&nbsp;
<span style="color: #339933;">            protected function date_labelFunc(item:Object, col:DataGridColumn):String {</span>
<span style="color: #339933;">                var time:Number = Date.parse(item[col.dataField]);</span>
<span style="color: #339933;">                return new Date(time).toDateString();</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            protected function arrColl_filterFunc(item:Object):Boolean {</span>
<span style="color: #339933;">                var cDate:Number = Date.parse(item.holidayDate);</span>
&nbsp;
<span style="color: #339933;">                if (!sDate || !eDate) {</span>
<span style="color: #339933;">                    return true;</span>
<span style="color: #339933;">                }</span>
&nbsp;
<span style="color: #339933;">                if (sDate.selectedDate &amp;&amp; eDate.selectedDate) {</span>
<span style="color: #339933;">                    return (sDate.selectedDate.time &lt;= cDate) &amp;&amp; (eDate.selectedDate.time &gt;= cDate);</span>
<span style="color: #339933;">                } else if (sDate.selectedDate) {</span>
<span style="color: #339933;">                    return sDate.selectedDate.time &lt;= cDate;</span>
<span style="color: #339933;">                } else if (eDate.selectedDate) {</span>
<span style="color: #339933;">                    return eDate.selectedDate.time &gt;= cDate;</span>
<span style="color: #339933;">                } else {</span>
<span style="color: #339933;">                    return true;</span>
<span style="color: #339933;">                }</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            protected function init():void {</span>
<span style="color: #339933;">                sDate.selectedDate = MIN_DATE;</span>
<span style="color: #339933;">                sDate.selectableRange = {rangeStart:MIN_DATE, rangeEnd:MAX_DATE};</span>
&nbsp;
<span style="color: #339933;">                eDate.selectedDate = MAX_DATE;</span>
<span style="color: #339933;">                eDate.selectableRange = sDate.selectableRange;</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:ArrayCollection</span> id=<span style="color: #ff0000;">&quot;arrColl&quot;</span> filterFunction=<span style="color: #ff0000;">&quot;arrColl_filterFunc&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:Array</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;New Years&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/1/1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Martin Luther King, Jr. Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/1/18&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Groundhog Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/2/2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Chinese New Year&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/2/14&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Valentine's Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/2/14&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;President's Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/2/15&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Ash Wednesday&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/2/17&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Daylight Saving Time starts&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/3/14&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;St. Patrick's Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/3/17&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;First Day of Spring&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/3/20&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;April Fool's Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/4/1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Easter&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/4/4&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Administrative Professional's Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/4/21&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Earth Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/4/22&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Cinco De Mayo&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/5/5&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Mothers Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/5/9&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Armed Forces Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/5/15&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Memorial Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/5/31&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Flag Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/6/14&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Father's Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/6/20&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Summer Begins&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/6/21&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Independence Day/July 4th&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/7/4&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Labor Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/9/6&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Grandparents Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/9/12&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;First Day of Autumn&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/9/23&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Columbus Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/10/11&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;United Nations Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/10/24&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Halloween&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/10/31&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;All Saints' Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/11/1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Daylight Saving Time Ends&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/11/7&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Veteran's Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/11/11&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Thanksgiving&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/11/25&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Wright Brothers Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/12/17&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;First Day Winter&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/12/21&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Christmas&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/12/25&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;New Years Eve&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/12/31&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>
&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:Form</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;Start date:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DateField</span> id=<span style="color: #ff0000;">&quot;sDate&quot;</span> change=<span style="color: #ff0000;">&quot;arrColl.refresh();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;End date:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DateField</span> id=<span style="color: #ff0000;">&quot;eDate&quot;</span> change=<span style="color: #ff0000;">&quot;arrColl.refresh();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</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;dGrid&quot;</span> dataProvider=<span style="color: #ff0000;">&quot;{arrColl}&quot;</span> width=<span style="color: #ff0000;">&quot;400&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;holidayName&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;holidayDate&quot;</span> labelFunction=<span style="color: #ff0000;">&quot;date_labelFunc&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>

<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/MX_DataGrid_filter_DateField_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/MX_DataGrid_filter_DateField_test/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Filtering an MX DataGrid control by date range using Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/02/01/filtering-an-mx-datagrid-control-by-date-range-using-flex/',contentID: 'post-2366',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'filterFunction,refresh(),selectableRange,selectedDate,time',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2010/02/01/filtering-an-mx-datagrid-control-by-date-range-using-flex/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Setting the background fill alpha on a Halo DataGrid control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/10/25/setting-the-background-fill-alpha-on-a-halo-datagrid-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/10/25/setting-the-background-fill-alpha-on-a-halo-datagrid-control-in-flex-4/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 05:43:52 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta2]]></category>
		<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[alternatingItemColors]]></category>
		<category><![CDATA[contentBackgroundAlpha]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2095</guid>
		<description><![CDATA[<p>The following example shows how you can set the background alpha on a Halo DataGrid control in Flex 4 by setting the contentBackgroundAlpha style and setting the alternatingItemColors style to an empty array.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/10/25/setting-the-background-fill-alpha-on-a-halo-datagrid-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Halo_DataGrid_contentBackgroundAlpha_test&#34; xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34; xmlns:mx=&#34;library://ns.adobe.com/flex/halo&#34;&#62; &#60;s:controlBarContent&#62; &#60;mx:Form styleName=&#34;plain&#34; backgroundAlpha=&#34;0.0&#34;&#62; &#60;mx:FormItem [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the background alpha on a Halo DataGrid control in Flex 4 by setting the <code>contentBackgroundAlpha</code> style and setting the <code>alternatingItemColors</code> style to an empty array.</p>
<p>Full code after the jump.</p>
<p><span id="more-2095"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/10/25/setting-the-background-fill-alpha-on-a-halo-datagrid-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Halo_DataGrid_contentBackgroundAlpha_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Form</span> styleName=<span style="color: #ff0000;">&quot;plain&quot;</span> backgroundAlpha=<span style="color: #ff0000;">&quot;0.0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;contentBackgroundAlpha:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HSlider</span> id=<span style="color: #ff0000;">&quot;sl&quot;</span></span>
<span style="color: #000000;">                        minimum=<span style="color: #ff0000;">&quot;0.0&quot;</span></span>
<span style="color: #000000;">                        maximum=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        value=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        stepSize=<span style="color: #ff0000;">&quot;0.1&quot;</span></span>
<span style="color: #000000;">                        snapInterval=<span style="color: #ff0000;">&quot;0.1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Panel</span> title=<span style="color: #ff0000;">&quot;Panel title&quot;</span></span>
<span style="color: #000000;">            backgroundColor=<span style="color: #ff0000;">&quot;yellow&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGrid</span> id=<span style="color: #ff0000;">&quot;dtGrd&quot;</span></span>
<span style="color: #000000;">                contentBackgroundColor=<span style="color: #ff0000;">&quot;red&quot;</span></span>
<span style="color: #000000;">                contentBackgroundAlpha=<span style="color: #ff0000;">&quot;{sl.value}&quot;</span></span>
<span style="color: #000000;">                alternatingItemColors=<span style="color: #ff0000;">&quot;[]&quot;</span></span>
<span style="color: #000000;">                rowCount=<span style="color: #ff0000;">&quot;6&quot;</span></span>
<span style="color: #000000;">                left=<span style="color: #ff0000;">&quot;20&quot;</span> right=<span style="color: #ff0000;">&quot;20&quot;</span> top=<span style="color: #ff0000;">&quot;20&quot;</span> bottom=<span style="color: #ff0000;">&quot;20&quot;</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:ArrayList</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;fx:Object</span> c1=<span style="color: #ff0000;">&quot;1.One&quot;</span> c2=<span style="color: #ff0000;">&quot;1.Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;2.One&quot;</span> c2=<span style="color: #ff0000;">&quot;2.Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;3.One&quot;</span> c2=<span style="color: #ff0000;">&quot;3.Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;4.One&quot;</span> c2=<span style="color: #ff0000;">&quot;4.Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;5.One&quot;</span> c2=<span style="color: #ff0000;">&quot;5.Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;6.One&quot;</span> c2=<span style="color: #ff0000;">&quot;6.Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;7.One&quot;</span> c2=<span style="color: #ff0000;">&quot;7.Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;8.One&quot;</span> c2=<span style="color: #ff0000;">&quot;8.Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;9.One&quot;</span> c2=<span style="color: #ff0000;">&quot;9.Two&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:ArrayList</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>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Panel</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the background fill alpha on a Halo DataGrid control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/10/25/setting-the-background-fill-alpha-on-a-halo-datagrid-control-in-flex-4/',contentID: 'post-2095',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'alternatingItemColors,contentBackgroundAlpha,Gumbo',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/10/25/setting-the-background-fill-alpha-on-a-halo-datagrid-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting the base color on the nested scrollbars in the MX DataGrid control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/09/27/setting-the-base-color-on-the-nested-scrollbars-in-the-halo-datagrid-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/09/27/setting-the-base-color-on-the-nested-scrollbars-in-the-halo-datagrid-control-in-flex-4/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 18:17:54 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[Flex4]]></category>
		<category><![CDATA[chromeColor]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[horizontalScrollBarStyleName]]></category>
		<category><![CDATA[verticalScrollBarStyleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1922</guid>
		<description><![CDATA[<p>The following example shows how you can change the base color on the MX DataGrid control&#8217;s horizontal and vertical scroll bars by setting the horizontalScrollBarStyleName and verticalScrollBarStyleName styles to a custom style containing the chromeColor style.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/09/27/setting-the-base-color-on-the-nested-scrollbars-in-the-halo-datagrid-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;MX_DataGrid_verticalScrollBarStyleName_test&#34; xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34; xmlns:mx=&#34;library://ns.adobe.com/flex/mx&#34;&#62; &#160; &#60;fx:Style&#62; .scrollBarStyles { chromeColor: haloBlue; } [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can change the base color on the MX DataGrid control&#8217;s horizontal and vertical scroll bars by setting the <code>horizontalScrollBarStyleName</code> and <code>verticalScrollBarStyleName</code> styles to a custom style containing the <code>chromeColor</code> style.</p>
<p><span id="more-1922"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/09/27/setting-the-base-color-on-the-nested-scrollbars-in-the-halo-datagrid-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;MX_DataGrid_verticalScrollBarStyleName_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        .scrollBarStyles {
            chromeColor: haloBlue;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</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;">            horizontalScrollPolicy=<span style="color: #ff0000;">&quot;on&quot;</span></span>
<span style="color: #000000;">            verticalScrollPolicy=<span style="color: #ff0000;">&quot;on&quot;</span></span>
<span style="color: #000000;">            horizontalScrollBarStyleName=<span style="color: #ff0000;">&quot;scrollBarStyles&quot;</span></span>
<span style="color: #000000;">            verticalScrollBarStyleName=<span style="color: #ff0000;">&quot;scrollBarStyles&quot;</span></span>
<span style="color: #000000;">            rowCount=<span style="color: #ff0000;">&quot;5&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;150&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</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:ArrayList</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx: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;fx: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;fx: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;fx: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;fx: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;fx: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;fx: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;fx: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;fx: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:ArrayList</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;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/MX_DataGrid_verticalScrollBarStyleName_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/MX_DataGrid_verticalScrollBarStyleName_test/main.html" width="100%" height="300"></iframe></p>
<p>You can also set the <code>horizontalScrollBarStyleName</code> and <code>verticalScrollBarStyleName</code> styles in an external .CSS file or &lt;Style/&gt; block, 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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/09/27/setting-the-base-color-on-the-nested-scrollbars-in-the-halo-datagrid-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;MX_DataGrid_verticalScrollBarStyleName_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/mx&quot;;
&nbsp;
        .scrollBarStyles {
            chromeColor: haloBlue;
        }
&nbsp;
        mx|DataGrid {
            horizontalScrollBarStyleName: scrollBarStyles;
            verticalScrollBarStyleName: scrollBarStyles;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</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;">            horizontalScrollPolicy=<span style="color: #ff0000;">&quot;on&quot;</span></span>
<span style="color: #000000;">            verticalScrollPolicy=<span style="color: #ff0000;">&quot;on&quot;</span></span>
<span style="color: #000000;">            rowCount=<span style="color: #ff0000;">&quot;5&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;150&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</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:ArrayList</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx: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;fx: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;fx: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;fx: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;fx: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;fx: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;fx: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;fx: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;fx: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:ArrayList</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;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>You can also set the <code>horizontalScrollBarStyleName</code> and <code>verticalScrollBarStyleName</code> styles using ActionScript, 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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/09/27/setting-the-base-color-on-the-nested-scrollbars-in-the-halo-datagrid-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;MX_DataGrid_verticalScrollBarStyleName_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;btn&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Set scroll bar style names&quot;</span></span>
<span style="color: #000000;">                click=<span style="color: #ff0000;">&quot;btn_click(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        .scrollBarStyles {
            chromeColor: haloBlue;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            protected function btn_click<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                dataGrid.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;horizontalScrollBarStyleName&quot;</span>, <span style="color: #ff0000;">&quot;scrollBarStyles&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dataGrid.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;verticalScrollBarStyleName&quot;</span>, <span style="color: #ff0000;">&quot;scrollBarStyles&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</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;">            horizontalScrollPolicy=<span style="color: #ff0000;">&quot;on&quot;</span></span>
<span style="color: #000000;">            verticalScrollPolicy=<span style="color: #ff0000;">&quot;on&quot;</span></span>
<span style="color: #000000;">            rowCount=<span style="color: #ff0000;">&quot;5&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;150&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</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:ArrayList</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx: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;fx: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;fx: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;fx: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;fx: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;fx: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;fx: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;fx: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;fx: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:ArrayList</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;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the base color on the nested scrollbars in the MX DataGrid control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/09/27/setting-the-base-color-on-the-nested-scrollbars-in-the-halo-datagrid-control-in-flex-4/',contentID: 'post-1922',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'chromeColor,Gumbo,horizontalScrollBarStyleName,verticalScrollBarStyleName',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/09/27/setting-the-base-color-on-the-nested-scrollbars-in-the-halo-datagrid-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using a CFF embedded font with a Halo DataGrid control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/08/21/using-a-cff-embedded-font-with-a-halo-datagrid-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/08/21/using-a-cff-embedded-font-with-a-halo-datagrid-control-in-flex-4/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 13:32:21 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[DataGridColumn]]></category>
		<category><![CDATA[defaultDataGridItemRenderer]]></category>
		<category><![CDATA[getStyleDeclaration()]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[itemRenderer]]></category>
		<category><![CDATA[TLFDataGridItemRenderer]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1695</guid>
		<description><![CDATA[<p>The following example shows how you can use a CFF embedded font with a Halo DataGrid container by setting the itemRenderer property or defaultDataGridItemRenderer style to the mx.controls.dataGridClasses.TLFDataGridItemRenderer class.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/08/21/using-a-cff-embedded-font-with-a-halo-datagrid-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Halo_DataGrid_TLFDataGridItemRenderer_test&#34; xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34; xmlns:mx=&#34;library://ns.adobe.com/flex/halo&#34;&#62; &#160; &#60;fx:Style&#62; @namespace s &#34;library://ns.adobe.com/flex/spark&#34;; @namespace mx &#34;library://ns.adobe.com/flex/halo&#34;; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use a CFF embedded font with a Halo DataGrid container by setting the <code>itemRenderer</code> property or <code>defaultDataGridItemRenderer</code> style to the mx.controls.dataGridClasses.TLFDataGridItemRenderer class.</p>
<p>Full code after the jump.</p>
<p><span id="more-1695"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/08/21/using-a-cff-embedded-font-with-a-halo-datagrid-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Halo_DataGrid_TLFDataGridItemRenderer_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/halo&quot;;
&nbsp;
        @font-face {
            src: url(&quot;assets/Arial.ttf&quot;);
            fontFamily: ArialCFF;
            embedAsCFF: true;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VGroup</span> horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <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;">                itemRenderer=<span style="color: #ff0000;">&quot;mx.controls.dataGridClasses.TLFDataGridItemRenderer&quot;</span></span>
<span style="color: #000000;">                fontFamily=<span style="color: #ff0000;">&quot;ArialCFF&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> <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> <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:ArrayList</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;1. One&quot;</span> c2=<span style="color: #ff0000;">&quot;1. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;2. One&quot;</span> c2=<span style="color: #ff0000;">&quot;2. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;3. One&quot;</span> c2=<span style="color: #ff0000;">&quot;3. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;4. One&quot;</span> c2=<span style="color: #ff0000;">&quot;4. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;5. One&quot;</span> c2=<span style="color: #ff0000;">&quot;5. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;6. One&quot;</span> c2=<span style="color: #ff0000;">&quot;6. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;7. One&quot;</span> c2=<span style="color: #ff0000;">&quot;7. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;8. One&quot;</span> c2=<span style="color: #ff0000;">&quot;8. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;9. One&quot;</span> c2=<span style="color: #ff0000;">&quot;9. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ArrayList</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>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SimpleText</span> text=<span style="color: #ff0000;">&quot;Spark SimpleText with embedded font&quot;</span> fontFamily=<span style="color: #ff0000;">&quot;ArialCFF&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:VGroup</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p>You can set the <code>defaultDataGridItemRenderer</code> style in MXML, 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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/08/21/using-a-cff-embedded-font-with-a-halo-datagrid-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Halo_DataGrid_TLFDataGridItemRenderer_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/halo&quot;;
&nbsp;
        @font-face {
            src: url(&quot;assets/Arial.ttf&quot;);
            fontFamily: ArialCFF;
            embedAsCFF: true;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VGroup</span> horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <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;">                defaultDataGridItemRenderer=<span style="color: #ff0000;">&quot;mx.controls.dataGridClasses.TLFDataGridItemRenderer&quot;</span></span>
<span style="color: #000000;">                fontFamily=<span style="color: #ff0000;">&quot;ArialCFF&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> <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> <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:ArrayList</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;1. One&quot;</span> c2=<span style="color: #ff0000;">&quot;1. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;2. One&quot;</span> c2=<span style="color: #ff0000;">&quot;2. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;3. One&quot;</span> c2=<span style="color: #ff0000;">&quot;3. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;4. One&quot;</span> c2=<span style="color: #ff0000;">&quot;4. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;5. One&quot;</span> c2=<span style="color: #ff0000;">&quot;5. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;6. One&quot;</span> c2=<span style="color: #ff0000;">&quot;6. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;7. One&quot;</span> c2=<span style="color: #ff0000;">&quot;7. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;8. One&quot;</span> c2=<span style="color: #ff0000;">&quot;8. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;9. One&quot;</span> c2=<span style="color: #ff0000;">&quot;9. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ArrayList</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>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SimpleText</span> text=<span style="color: #ff0000;">&quot;Spark SimpleText with embedded font&quot;</span> fontFamily=<span style="color: #ff0000;">&quot;ArialCFF&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:VGroup</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Or, you also set the <code>defaultDataGridItemRenderer</code> style globally in an external .CSS file or &lt;Style/&gt; block, 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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/08/21/using-a-cff-embedded-font-with-a-halo-datagrid-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Halo_DataGrid_TLFDataGridItemRenderer_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/halo&quot;;
&nbsp;
        @font-face {
            src: url(&quot;assets/Arial.ttf&quot;);
            fontFamily: ArialCFF;
            embedAsCFF: true;
        }
&nbsp;
        mx|DataGrid {
            defaultDataGridItemRenderer: ClassReference(&quot;mx.controls.dataGridClasses.TLFDataGridItemRenderer&quot;);
            fontFamily: ArialCFF;
        }
&nbsp;
        s|SimpleText {
            fontFamily: ArialCFF;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VGroup</span> horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGrid</span> id=<span style="color: #ff0000;">&quot;dataGrid&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> <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> <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:ArrayList</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;1. One&quot;</span> c2=<span style="color: #ff0000;">&quot;1. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;2. One&quot;</span> c2=<span style="color: #ff0000;">&quot;2. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;3. One&quot;</span> c2=<span style="color: #ff0000;">&quot;3. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;4. One&quot;</span> c2=<span style="color: #ff0000;">&quot;4. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;5. One&quot;</span> c2=<span style="color: #ff0000;">&quot;5. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;6. One&quot;</span> c2=<span style="color: #ff0000;">&quot;6. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;7. One&quot;</span> c2=<span style="color: #ff0000;">&quot;7. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;8. One&quot;</span> c2=<span style="color: #ff0000;">&quot;8. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;9. One&quot;</span> c2=<span style="color: #ff0000;">&quot;9. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ArrayList</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>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SimpleText</span> text=<span style="color: #ff0000;">&quot;Spark SimpleText with embedded font&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:VGroup</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/08/21/using-a-cff-embedded-font-with-a-halo-datagrid-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Halo_DataGrid_TLFDataGridItemRenderer_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span></span>
<span style="color: #000000;">        initialize=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import mx.collections.ArrayList;</span>
<span style="color: #000000;">            import mx.controls.DataGrid;</span>
<span style="color: #000000;">            import mx.controls.dataGridClasses.DataGridColumn;</span>
<span style="color: #000000;">            import mx.controls.dataGridClasses.TLFDataGridItemRenderer;</span>
<span style="color: #000000;">            import spark.components.VGroup;</span>
<span style="color: #000000;">            import spark.primitives.SimpleText;</span>
&nbsp;
<span style="color: #000000;">            <span style="color: #66cc66;">&#91;</span>Embed<span style="color: #66cc66;">&#40;</span>source=<span style="color: #ff0000;">&quot;assets/Arial.ttf&quot;</span>,</span>
<span style="color: #000000;">                    fontFamily=<span style="color: #ff0000;">&quot;ArialCFF&quot;</span>,</span>
<span style="color: #000000;">                    embedAsCFF=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span></span>
<span style="color: #000000;">            private const ArialEmbeddedFont:Class;</span>
&nbsp;
<span style="color: #000000;">            private var dataGrid:DataGrid;</span>
<span style="color: #000000;">            private var simpleTxt:SimpleText;</span>
&nbsp;
<span style="color: #000000;">            private function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var dp:ArrayList = new ArrayList<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;1. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;1. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;2. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;2. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;3. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;3. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;4. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;4. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;5. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;5. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;6. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;6. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;7. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;7. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;8. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;8. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;9. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;9. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var cols:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">                cols.push<span style="color: #66cc66;">&#40;</span>new DataGridColumn<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;c1&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                cols.push<span style="color: #66cc66;">&#40;</span>new DataGridColumn<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;c2&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                dataGrid = new DataGrid<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dataGrid.columns = cols;</span>
<span style="color: #000000;">                dataGrid.dataProvider = dp;</span>
<span style="color: #000000;">                dataGrid.itemRenderer = new ClassFactory<span style="color: #66cc66;">&#40;</span>TLFDataGridItemRenderer<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dataGrid.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;fontFamily&quot;</span>, <span style="color: #ff0000;">&quot;ArialCFF&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                simpleTxt = new SimpleText<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                simpleTxt.text = <span style="color: #ff0000;">&quot;Spark SimpleText with embedded font&quot;</span>;</span>
<span style="color: #000000;">                simpleTxt.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;fontFamily&quot;</span>, <span style="color: #ff0000;">&quot;ArialCFF&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var vGr:VGroup = new VGroup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                vGr.horizontalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                vGr.verticalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                vGr.addElement<span style="color: #66cc66;">&#40;</span>dataGrid<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                vGr.addElement<span style="color: #66cc66;">&#40;</span>simpleTxt<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                addElement<span style="color: #66cc66;">&#40;</span>vGr<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Or, you can use the StyleManager class and set the <code>defaultDataGridItemRenderer</code> style globally, 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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/08/21/using-a-cff-embedded-font-with-a-halo-datagrid-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Halo_DataGrid_TLFDataGridItemRenderer_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span></span>
<span style="color: #000000;">        initialize=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import mx.collections.ArrayList;</span>
<span style="color: #000000;">            import mx.controls.DataGrid;</span>
<span style="color: #000000;">            import mx.controls.dataGridClasses.DataGridColumn;</span>
<span style="color: #000000;">            import mx.controls.dataGridClasses.TLFDataGridItemRenderer;</span>
<span style="color: #000000;">            import spark.components.VGroup;</span>
<span style="color: #000000;">            import spark.primitives.SimpleText;</span>
&nbsp;
<span style="color: #000000;">            <span style="color: #66cc66;">&#91;</span>Embed<span style="color: #66cc66;">&#40;</span>source=<span style="color: #ff0000;">&quot;assets/Arial.ttf&quot;</span>,</span>
<span style="color: #000000;">                    fontFamily=<span style="color: #ff0000;">&quot;ArialCFF&quot;</span>,</span>
<span style="color: #000000;">                    embedAsCFF=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span></span>
<span style="color: #000000;">            private const ArialEmbeddedFont:Class;</span>
&nbsp;
<span style="color: #000000;">            private var dataGrid:DataGrid;</span>
<span style="color: #000000;">            private var simpleTxt:SimpleText;</span>
&nbsp;
<span style="color: #000000;">            private function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var dgStyles:CSSStyleDeclaration = StyleManager.getStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;mx.controls.DataGrid&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>!dgStyles<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> /* null check */</span>
<span style="color: #000000;">                    dgStyles = new CSSStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;mx.controls.DataGrid&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">                dgStyles.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;defaultDataGridItemRenderer&quot;</span>, TLFDataGridItemRenderer<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dgStyles.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;fontFamily&quot;</span>, <span style="color: #ff0000;">&quot;ArialCFF&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var stStyles:CSSStyleDeclaration = StyleManager.getStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;spark.primitives.SimpleText&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>!stStyles<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> /* null check */</span>
<span style="color: #000000;">                    stStyles = new CSSStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;spark.primitives.SimpleText&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">                stStyles.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;fontFamily&quot;</span>, <span style="color: #ff0000;">&quot;ArialCFF&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var dp:ArrayList = new ArrayList<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;1. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;1. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;2. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;2. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;3. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;3. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;4. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;4. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;5. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;5. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;6. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;6. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;7. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;7. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;8. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;8. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dp.addItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>c1:<span style="color: #ff0000;">&quot;9. One&quot;</span>, c2:<span style="color: #ff0000;">&quot;9. Two&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var cols:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">                cols.push<span style="color: #66cc66;">&#40;</span>new DataGridColumn<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;c1&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                cols.push<span style="color: #66cc66;">&#40;</span>new DataGridColumn<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;c2&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                dataGrid = new DataGrid<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                dataGrid.columns = cols;</span>
<span style="color: #000000;">                dataGrid.dataProvider = dp;</span>
&nbsp;
<span style="color: #000000;">                simpleTxt = new SimpleText<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                simpleTxt.text = <span style="color: #ff0000;">&quot;Spark SimpleText with embedded font&quot;</span>;</span>
&nbsp;
<span style="color: #000000;">                var vGr:VGroup = new VGroup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                vGr.horizontalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                vGr.verticalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                vGr.addElement<span style="color: #66cc66;">&#40;</span>dataGrid<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                vGr.addElement<span style="color: #66cc66;">&#40;</span>simpleTxt<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                addElement<span style="color: #66cc66;">&#40;</span>vGr<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using a CFF embedded font with a Halo DataGrid control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/08/21/using-a-cff-embedded-font-with-a-halo-datagrid-control-in-flex-4/',contentID: 'post-1695',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'defaultDataGridItemRenderer,getStyleDeclaration(),Gumbo,itemRenderer,TLFDataGridItemRenderer',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/08/21/using-a-cff-embedded-font-with-a-halo-datagrid-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Setting the icon color on the Halo DataGrid control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/07/22/setting-the-icon-color-on-the-halo-datagrid-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/07/22/setting-the-icon-color-on-the-halo-datagrid-control-in-flex-4/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 06:59:10 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[symbolColor]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1385</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2009/07/21/setting-the-icon-color-on-the-datagrid-control-in-flex/">&#8220;Setting the icon color on the DataGrid control in Flex&#8221;</a>, we saw how you could set the icon color (the sort arrow color in the DataGrid header and arrows icons in the horizontal/vertical scrollbar) on a Flex DataGrid control by setting the iconColor style.</p> <p>The following example shows how you [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2009/07/21/setting-the-icon-color-on-the-datagrid-control-in-flex/">&#8220;Setting the icon color on the DataGrid control in Flex&#8221;</a>, we saw how you could set the icon color (the sort arrow color in the DataGrid header and arrows icons in the horizontal/vertical scrollbar) on a Flex DataGrid control by setting the <code>iconColor</code> style.</p>
<p>The following example shows how you can set the icon/symbol color on a Halo DataGrid control (with default Spark skin) in Flex 4 by setting the <code>symbolColor</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-1385"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/07/22/setting-the-icon-color-on-the-halo-datagrid-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Halo_DataGrid_symbolColor_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> cornerRadius=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Form</span> styleName=<span style="color: #ff0000;">&quot;plain&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;symbolColor:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColorPicker</span> id=<span style="color: #ff0000;">&quot;colorPicker&quot;</span></span>
<span style="color: #000000;">                        selectedColor=<span style="color: #ff0000;">&quot;black&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</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;">            dataProvider=<span style="color: #ff0000;">&quot;{Font.enumerateFonts(true)}&quot;</span></span>
<span style="color: #000000;">            symbolColor=<span style="color: #ff0000;">&quot;{colorPicker.selectedColor}&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/Halo_DataGrid_symbolColor_test/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/spark/Halo_DataGrid_symbolColor_test/bin/main.html" width="100%" height="300"></iframe></p>
<p>You can also set the <code>symbolColor</code> style in an external .CSS file or &lt;Style/&gt; block, 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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/07/22/setting-the-icon-color-on-the-halo-datagrid-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Halo_DataGrid_symbolColor_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/halo&quot;;
&nbsp;
        mx|DataGrid {
            symbolColor: red;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</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;">            dataProvider=<span style="color: #ff0000;">&quot;{Font.enumerateFonts(true)}&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Or, you can set the <code>symbolColor</code> style using ActionScript, 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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/07/22/setting-the-icon-color-on-the-halo-datagrid-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Halo_DataGrid_symbolColor_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import mx.events.ColorPickerEvent;</span>
&nbsp;
<span style="color: #000000;">            protected function colorPicker_change<span style="color: #66cc66;">&#40;</span>evt:ColorPickerEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                dataGrid.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;symbolColor&quot;</span>, evt.color<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> cornerRadius=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Form</span> styleName=<span style="color: #ff0000;">&quot;plain&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;symbolColor:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColorPicker</span> id=<span style="color: #ff0000;">&quot;colorPicker&quot;</span></span>
<span style="color: #000000;">                        selectedColor=<span style="color: #ff0000;">&quot;black&quot;</span></span>
<span style="color: #000000;">                        change=<span style="color: #ff0000;">&quot;colorPicker_change(event);&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</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;">            dataProvider=<span style="color: #ff0000;">&quot;{Font.enumerateFonts(true)}&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the icon color on the Halo DataGrid control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/07/22/setting-the-icon-color-on-the-halo-datagrid-control-in-flex-4/',contentID: 'post-1385',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,symbolColor',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/07/22/setting-the-icon-color-on-the-halo-datagrid-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting the icon color on the DataGrid control in Flex</title>
		<link>http://blog.flexexamples.com/2009/07/21/setting-the-icon-color-on-the-datagrid-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2009/07/21/setting-the-icon-color-on-the-datagrid-control-in-flex/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 06:59:00 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[iconColor]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1379</guid>
		<description><![CDATA[<p>The following example shows how you can set the icon color (the sort arrow color in the DataGrid header and arrows icons in the horizontal/vertical scrollbar) on a Flex DataGrid control by setting the iconColor style.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/07/21/setting-the-icon-color-on-the-datagrid-control-in-flex/ --&#62; &#60;mx:Application name=&#34;DataGrid_iconColor_test&#34; xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;vertical&#34; verticalAlign=&#34;middle&#34; backgroundColor=&#34;white&#34;&#62; &#160; &#60;mx:ApplicationControlBar dock=&#34;true&#34;&#62; &#60;mx:Form styleName=&#34;plain&#34;&#62; &#60;mx:FormItem [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the icon color (the sort arrow color in the DataGrid header and arrows icons in the horizontal/vertical scrollbar) on a Flex DataGrid control by setting the <code>iconColor</code> style.</p>
<p><span id="more-1379"></span></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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/07/21/setting-the-icon-color-on-the-datagrid-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;DataGrid_iconColor_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</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:Form</span> styleName=<span style="color: #ff0000;">&quot;plain&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;iconColor:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColorPicker</span> id=<span style="color: #ff0000;">&quot;colorPicker&quot;</span></span>
<span style="color: #000000;">                        selectedColor=<span style="color: #ff0000;">&quot;black&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</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;">            dataProvider=<span style="color: #ff0000;">&quot;{Font.enumerateFonts(true)}&quot;</span></span>
<span style="color: #000000;">            iconColor=<span style="color: #ff0000;">&quot;{colorPicker.selectedColor}&quot;</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 class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/DataGrid_iconColor_test/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/DataGrid_iconColor_test/bin/main.html" width="100%" height="300"></iframe></p>
<p>You can also set the <code>iconColor</code> style in an external .CSS file or &lt;Style/&gt; block, 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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/07/21/setting-the-icon-color-on-the-datagrid-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;DataGrid_iconColor_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        DataGrid {
            iconColor: red;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Style</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;">            dataProvider=<span style="color: #ff0000;">&quot;{Font.enumerateFonts(true)}&quot;</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>Or, you can set the <code>iconColor</code> style using ActionScript, 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: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/07/21/setting-the-icon-color-on-the-datagrid-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;DataGrid_iconColor_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&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;">            import mx.events.ColorPickerEvent;</span>
&nbsp;
<span style="color: #339933;">            protected function colorPicker_change(evt:ColorPickerEvent):void {</span>
<span style="color: #339933;">                dataGrid.setStyle(&quot;iconColor&quot;, evt.color);</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:Form</span> styleName=<span style="color: #ff0000;">&quot;plain&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;iconColor:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColorPicker</span> id=<span style="color: #ff0000;">&quot;colorPicker&quot;</span></span>
<span style="color: #000000;">                        selectedColor=<span style="color: #ff0000;">&quot;black&quot;</span></span>
<span style="color: #000000;">                        change=<span style="color: #ff0000;">&quot;colorPicker_change(event);&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</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;">            dataProvider=<span style="color: #ff0000;">&quot;{Font.enumerateFonts(true)}&quot;</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 class="alert">For an example of how to do this in Flex 4, see <a href="http://blog.flexexamples.com/2009/07/22/setting-the-icon-color-on-the-halo-datagrid-control-in-flex-4/">&#8220;Setting the icon color on the Halo DataGrid control in Flex 4&#8243;</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the icon color on the DataGrid control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/07/21/setting-the-icon-color-on-the-datagrid-control-in-flex/',contentID: 'post-1379',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'iconColor',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/07/21/setting-the-icon-color-on-the-datagrid-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

