<?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; horizontalSeparatorSkin</title>
	<atom:link href="http://blog.flexexamples.com/tag/horizontalseparatorskin/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>Styling the Flex DataGrid control using a custom separator skins</title>
		<link>http://blog.flexexamples.com/2007/08/28/styling-the-flex-datagrid-control-using-a-custom-separator-skins/</link>
		<comments>http://blog.flexexamples.com/2007/08/28/styling-the-flex-datagrid-control-using-a-custom-separator-skins/#comments</comments>
		<pubDate>Tue, 28 Aug 2007 20:23:48 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[headerSeparatorSkin]]></category>
		<category><![CDATA[horizontalGridLines]]></category>
		<category><![CDATA[horizontalSeparatorSkin]]></category>
		<category><![CDATA[verticalGridLines]]></category>
		<category><![CDATA[verticalSeparatorSkin]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/28/styling-the-flex-datagrid-control-using-a-custom-separator-skins/</guid>
		<description><![CDATA[<p>The following example demonstrates how you can customize the Flex 3 DataGrid control by specifying a custom skin for the horizontalSeparatorSkin and verticalSeparatorSkin styles.</p> <p class="alert">These styles were added in Flex 3 and will not work with Flex 2.0.1.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/DataGrid_verticalSeparatorSkin_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2007/08/28/styling-the-flex-datagrid-control-using-a-custom-separator-skins/ --&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example demonstrates how you can customize the Flex 3 DataGrid control by specifying a custom skin for the <code>horizontalSeparatorSkin</code> and <code>verticalSeparatorSkin</code> styles.</p>
<p class="alert">These styles were added in Flex 3 and will not work with Flex 2.0.1.</p>
<p>Full code after the jump.</p>
<p><span id="more-141"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/DataGrid_verticalSeparatorSkin_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/08/28/styling-the-flex-datagrid-control-using-a-custom-separator-skins/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            [Bindable]
            [Embed(source="./assets/redbluebar.gif")]
            private var RedBlueBar:Class;

            [Bindable]
            [Embed(source="./assets/greencircle.png")]
            private var GreenCircle:Class;
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Style&gt;
        .centered {
            fontWeight: bold;
            textAlign: center;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object country="USA"
                gold="35"
                silver="39"
                bronze="29" /&gt;
        &lt;mx:Object country="China"
                gold="32"
                silver="17"
                bronze="14" /&gt;
        &lt;mx:Object country="Russia"
                gold="27"
                silver="27"
                bronze="38" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:CheckBox id="hGridLines"
                label="horizontalGridLines"
                selected="true" /&gt;

        &lt;mx:Spacer width="50" /&gt;

        &lt;mx:CheckBox id="vGridLines"
                label="verticalGridLines"
                selected="true" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:DataGrid id="dataGrid"
            dataProvider="{arr}"
            headerStyleName="centered"
            headerSeparatorSkin="{GreenCircle}"
            horizontalSeparatorSkin="{RedBlueBar}"
            horizontalGridLines="{hGridLines.selected}"
            verticalSeparatorSkin="{RedBlueBar}"
            verticalGridLines="{vGridLines.selected}"&gt;
        &lt;mx:columns&gt;
            &lt;mx:DataGridColumn dataField="country"
                    headerText="Country:"
                    textAlign="left" /&gt;
            &lt;mx:DataGridColumn dataField="gold"
                    headerText="Gold:"
                    textAlign="right" /&gt;
            &lt;mx:DataGridColumn dataField="silver"
                    headerText="Silver:"
                    textAlign="right" /&gt;
            &lt;mx:DataGridColumn dataField="bronze"
                    headerText="Bronze:"
                    textAlign="right" /&gt;
        &lt;/mx:columns&gt;
    &lt;/mx:DataGrid&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/DataGrid_verticalSeparatorSkin_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/DataGrid_verticalSeparatorSkin_test/bin/main.html" width="100%" height="250"></iframe></p>
<p>The &#8220;redbluebar.gif&#8221; asset in the above example is a simple 10 pixel wide by 2 pixel high GIF which gets stretched horizontally to fit the width of the data grid (when used as a horizontal separator skin). The same asset was used as a vertical separator skin in which case it gets stretched vertically to match the data grid&#8217;s height). It is very important to note that the skin asset is stretched and not tiled/repeated. Secondly, the &#8220;greencircle.png&#8221; asset in the above example is a 10 pixel by 10 pixel green circle with a transparent background. It also gets stretched vertically to match the current height of the data grid&#8217;s header (as specified by the <code>headerHeight</code> property).</p>
<p>Not the prettiest of samples, I know. But you can view the full source code by right-clicking in the SWF above and downloading all the code/assets.</p>
<p class="note">If all you want to do is change the color of the DataGrid control&#8217;s horizontal and vertical lines, you can use the <code>horizontalGridLineColor</code> and <code>verticalGridLineColor</code> styles, which also work in Flex 2.0.1. For more information, see <a href="http://blog.flexexamples.com/2007/07/23/toggling-a-datagrid-controls-horizontal-grid-lines-and-vertical-grid-lines/">&#8220;Toggling a DataGrid control’s horizontal grid lines and vertical grid lines&#8221;</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Styling the Flex DataGrid control using a custom separator skins on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/08/28/styling-the-flex-datagrid-control-using-a-custom-separator-skins/',contentID: 'post-141',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'headerSeparatorSkin,horizontalGridLines,horizontalSeparatorSkin,verticalGridLines,verticalSeparatorSkin',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/2007/08/28/styling-the-flex-datagrid-control-using-a-custom-separator-skins/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

