2 Replies Latest reply on Jan 5, 2010 9:07 AM by Jarrod_P

    Image in DataGrid Too Large

    Jarrod_P

       

      I'm new.  When I put a 16x16 gif in a datagrid, it sizes too big.  When I put the image outsidwe the datagrid it looks correct?  Is it trying to fill the height of it's container in the datagrid?

        • 1. Re: Image in DataGrid Too Large
          Matt Le Fevre Level 4

          Post your item renderer code.

          • 2. Re: Image in DataGrid Too Large
            Jarrod_P Level 1

            <mx:itemRenderer>

             

             

             

             

                 <mx:Component>

             

                      <mx:Image horizontalAlign="center" >

             

             

                           <mx:Script>

                                <![CDATA[

                                     [

            Embed(source="../assets/images/flags/Flag_Red.gif")]

             

                                     var redFlag:Class;

                                     [

            Embed(source="../assets/images/flags/Flag_Blue.gif")]

             

                                     var blueFlag:Class;

                                     [

            Embed(source="../assets/images/flags/Flag_Green.gif")]

             

                                     var greenFlag:Class;

             

                                     override public function set data( value:Object ) : void {

             

                                          super.data = value;

             

                                          var flag:String = value.Flag;

             

                                          if (flag == "1")

             

                                               this.source = redFlag;

             

                                          else if (flag == "2")

             

                                               this.source = blueFlag;

             

                                          else if (flag == "3")

             

                                               this.source = greenFlag;

             

                                          else

             

             

                                               this.source = null;

                                     }

                                ]]>

             

                           </mx:Script>

             

                      </mx:Image>

             

                 </mx:Component>

             

             

            </mx:itemRenderer>