The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 2 of 2

Thread: Creating Grid/GridRow/GridItem using Actionscript in Flex

  1. #1

    Create border around Grid/GridItem

    Hi,

    I am stuck with a problem and no idea on how to proceed on this.

    I have created a Grid and want to draw border around it so its appearance is like table. The borders are just not appearing. Can someone provide any direction what I may be missing.

    Here is the code


    PHP Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
        <mx:Style>
            Grid
            {
                horizontal-gap:-1;
                vertical-gap:-1;
                border-color:#000000;
                border-style:solid;
                border-thickness:5;
            }
            GridItem
            {
                border-color:#000000;
                border-style:solid;
                border-thickness:5;
            }
        </mx:Style>

        <mx:Grid x="31" y="24">
            <mx:GridRow>
                <mx:GridItem width="100" height="30">
                    <mx:Label text ="Nitin">
                        
                    </mx:Label>
                </mx:GridItem>
                <mx:GridItem width="100" height="30">
                    <mx:Label text ="Nitin">
                        
                    </mx:Label>
                </mx:GridItem>
                <mx:GridItem width="100" colSpan="2" height="30">
                    <mx:Label text ="Nitin">
                        
                    </mx:Label>
                </mx:GridItem>
            </mx:GridRow>
            
            <mx:GridRow>
                <mx:GridItem width="100" height="30">
                    <mx:Label text ="Nitin">
                        
                    </mx:Label>
                </mx:GridItem>
                <mx:GridItem width="120" colSpan="2" height="30">
                    <mx:Label text ="Nitin">
                        
                    </mx:Label>
                </mx:GridItem>
                <mx:GridItem width="100" colSpan="3" height="11">
                    <mx:Label text ="Nitin">
                        
                    </mx:Label>
                </mx:GridItem>
            </mx:GridRow>
            
            <mx:GridRow>
                <mx:GridItem width="100" height="30">
                    <mx:Label text ="Nitin">
                        
                    </mx:Label>
                </mx:GridItem>
                <mx:GridItem width="100" height="30">
                    <mx:Label text ="Nitin">
                        
                    </mx:Label>
                </mx:GridItem>
                <mx:GridItem width="120" colSpan="3" height="30">
                    <mx:Label text ="Nitin">
                        
                    </mx:Label>
                </mx:GridItem>
            </mx:GridRow>
        </mx:Grid>
    </mx:Application>
    Last edited by nitinmukesh; November 25th, 2011 at 03:41 AM.
    Bug? That's not a bug, that's a feature.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rich Coo

  2. #2
    Problem solved.

    Using graphics property of Grid Item and horizontal/vertical gap.

    gridItem1.graphics.lineStyle(borderSize, borderColor);
    gridItem1.graphics.drawRoundRect(0, 0, 250, 100, cornerRadius);

    grid.setStyle("horizontalGap", "0");
    grid.setStyle("verticalGap", "0");
    Bug? That's not a bug, that's a feature.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rich Coo

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012