If the column of your grid is fixed, then it would be okay, we just need to
know how many columns do you have.

I don't know if this simple code below could help, try to run and see.

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute"
horizontalScrollPolicy="off">
    <mx:Script>
        <![CDATA[
            import
mx.controls.advancedDataGridClasses.AdvancedDataGridColumn;

            private function getCols():Array
            {
                var col:AdvancedDataGridColumn;
                var cols:Array = new Array();

                // let's say we have 10 cols
                for(var i:int = 0; i < 10; i++)
                {
                    col = new AdvancedDataGridColumn();
                    col.headerText = "A";
                    col.width = getColWidth();
                    cols.push(col);
                }

                return cols;
            }

            private function getColWidth():int
            {
                var w:int = this.width / 10; // 10 is the number of columns
                return w;
            }

        ]]>
    </mx:Script>

    <mx:AdvancedDataGrid height="100%" columns="{getCols()}"/>
</mx:Application>

On Thu, Mar 19, 2009 at 5:16 PM, yossi.baram <yossi.ba...@yahoo.com> wrote:

>   Hey,
> It is fixed when the grid is loded...
> So, what do you think, Can we set the app and the grid to be matched in
> size?
> The padding I get on the size of the grid are a problem because they
> produce horizontal scroll bar.
> Remember, the open area the SWF is presented is the exact size of the grid,
> but you see a scroll bar because the application is wider,
>
> Thanks
>
>
> --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, Romeo
> Obane <ro...@...> wrote:
> >
> > Oh, thanks for clearing more your concern.
> >
> > One more thing, your width for each column is fixed?
> >
> > If yes, we can easily set the width of each column to be flexible of the
> app
> > width, BUT if it's dynamic (depends on the data size), it could be more
> > tricky since the grid column usually don't have percent width.
> >
> > On Thu, Mar 19, 2009 at 3:45 PM, yossi.baram <yossi.ba...@...> wrote:
> >
> > > Hi,
> > > I miss led you a bit,
> > > I use a css and I can eliminate the background color of the application
> to
> > > white so I can see only the grid.
> > > I set the height of the grid to 100% BUT not the width because I create
> the
> > > colums dynamically and set width for each column.
> > > in my mxml:
> > > <script>
> > > // this is the function the sets the columns
> > > private function setColumnProperties(columnId:String,
> > > columns:Object):AdvancedDataGridColumn{
> > > var tableColumn:TableColumn = columns[columnId] as TableColumn;
> > > var dgc:AdvancedDataGridColumn = null;
> > > if(tableColumn.visible){
> > > dgc = new AdvancedDataGridColumn();
> > > dgc.dataField = columnId;
> > > dgc.width = tableColumn.width;
> > > dgc.headerText = tableColumn.header;
> > > dgc.sortable = tableColumn.sortable;
> > > }
> > > return dgc;
> > > }
> > > </script>
> > > <mx:AdvancedDataGrid id="adg" styleName="grid" height="100%"
> > > folderClosedIcon="{null}" folderOpenIcon="{null}"
> defaultLeafIcon="{null}"
> > > paddingBottom="0" paddingLeft="0" paddingRight="0" paddingTop="0"
> > > >
> > >
> > > The result I get is the grid with horizontal scroll bar (because the
> > > application width is greater then my grid)
> > > turning the scroll bar off doesnt solve the issue that the app is
> greater
> > > in width then my grid, why cant I match the width size of the app and
> the
> > > grid?
> > >
> > > I hope I'm understud :)
> > >
> > >
> > > --- In flexcoders@yahoogroups.com 
> > > <flexcoders%40yahoogroups.com><flexcoders%
> 40yahoogroups.com>, Romeo
> > > Obane <romeo@> wrote:
> > > >
> > > > One of the simple ways to change your Application Background default
> > > color,
> > > > is thru your css. Below is the sample codes.
> > > >
> > > > e.g. 1
> > > >
> > > > // For gradient colors
> > > >
> > > > Application
> > > > {
> > > > backgroundGradientAlphas: 1.0, 0.59;
> > > > backgroundGradientColors: #000000, #4D91BF;
> > > > }
> > > >
> > > > e.g. 1
> > > > // For Solid colors
> > > >
> > > > Application
> > > > {
> > > > background-color: blue;
> > > > }
> > > >
> > > >
> > > > Regarding the Grid, I tried the same way that you did, but it does
> occupy
> > > > the whole width and height of my application space.
> > > > Did you placed your grid inside the container aside of the main
> > > application
> > > > itself?
> > > >
> > > > Maybe if you could share some of the codes that could help me
> understand
> > > > more.
> > > >
> > > > On Thu, Mar 19, 2009 at 2:57 PM, yossi.baram <yossi.baram@> wrote:
> > > >
> > > > > Yep, the Apllication background I guess,
> > > > > I created the grid as a Tag and sent the with & height values for
> the
> > > > > Application.
> > > > > I set width="100%" and height="100%" for the grid and the height is
> > > showing
> > > > > great with no padding but on the sides of the grid I get 20px of
> blue
> > > > > background on each side althogh I set width to 100%
> > > > > Why is that?
> > > > >
> > > > > Thanks man
> > > > >
> > > > >
> > > > > --- In flexcoders@yahoogroups.com 
> > > > > <flexcoders%40yahoogroups.com><flexcoders%
> 40yahoogroups.com><flexcoders%
>
> > > 40yahoogroups.com>, Romeo
> > > > > Obane <romeo@> wrote:
> > > > > >
> > > > > > You mean changing the Application's or Data Grid default
> background?
> > > > > >
> > > > > > On Thu, Mar 19, 2009 at 1:28 PM, yossi.baram <yossi.baram@>
> wrote:
> > > > > >
> > > > > > > Greate man :)
> > > > > > >
> > > > > > > I missed that.... Thanks a lot,
> > > > > > >
> > > > > > > One more :),
> > > > > > > Do you know how can I eliminate the blue background of the
> > > application
> > > > > > > containing my greed?
> > > > > > > I just need to show the grid in an area without the colored
> > > background
> > > > > > >
> > > > > > > thanks again
> > > > > > >
> > > > > > >
> > > > > > > --- In 
> > > > > > > flexcoders@yahoogroups.com<flexcoders%40yahoogroups.com><flexcoders%
> 40yahoogroups.com><flexcoders%
> > > 40yahoogroups.com><flexcoders%
> > > > > 40yahoogroups.com>, Romeo
> > > > > > > Obane <romeo@> wrote:
> > > > > > > >
> > > > > > > > You can go and see for the style property of AdvancedDataGrid
> "
> > > > > > > > alternatingItemColors".
> > > > > > > >
> > > > > > >
> > > > >
> > >
> http://livedocs.adobe.com/flex/3/langref/mx/controls/AdvancedDataGrid.html
> > > > > > > >
> > > > > > > > On Thu, Mar 19, 2009 at 7:00 AM, yossi.baram <yossi.baram@>
> > > wrote:
> > > > > > > >
> > > > > > > > > Hi helper,
> > > > > > > > > In Adobe developer guid in all examples of treeGrid every
> > > second
> > > > > row
> > > > > > > has a
> > > > > > > > > background greyed color
> > > > > > > > >
> > > > > > >
> > > > >
> > >
> http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_10.html
> > > > > > > > > I need the same thing, 2 colors alternatly,
> > > > > > > > > How do I do it?
> > > > > > > > >
> > > > > > > > > Thanks
> > > > > > > > > Jo
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> >
>
>  
>

Reply via email to