0 Replies Latest reply on Jun 6, 2011 9:36 PM by rsi610

    How to get rounded corners for Grid in flex 3.0

    rsi610

      Hi All,

       

      I was trying to make rounded corners for ‘Advanced Datagrid’ and ‘Datagrid’ components of Flex 3.0. But was unable to do so.
      Also  tried searching the net for some solution but didn’t get much help for the problem.
      I tried making a skin and applying it , but still wasn’t successful.

       


      Can you please guide me in making the corners rounded for the 2 components.

       


      Thanks
      RSI

       

       

       

      e.g of my code

       

      <mx:AdvancedDataGrid id="myADG"
      headerBackgroundSkin="com.coresecurity.ui.view.skin.RoundImageSkin"  dataProvider="{dpFlat}"
              width="100%" height="100%">
              <mx:Columns>
                  <mx:AdvancedDataGridColumn headerText= “1” dataField="1"/>
                  <mx:AdvancedDataGridColumn headerText = “ 2” dataField="2"/>
                  <mx:AdvancedDataGridColumn dataField="3"
                      headerText="3"/>
              </mx:Columns>
         </mx:AdvancedDataGrid>

       

       

       

       

       

       

       

      RoundImageSkin.as

       

       

       

       

       

       

       

      public class RoundImageSkin extends RectangularBorder

       

      {

       

      public RoundImageSkin(){

       

      super();

       

      }

       

      override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void

       

      {

       

      var cls:Object = getStyle("backgroundImage");

       

      var bmp:Bitmap = new cls();

       

      graphics.clear();

       

      graphics.beginBitmapFill(bmp.bitmapData);

       

      graphics.drawRoundRect(0, 0, unscaledWidth, unscaledHeight,5);

       

      }
      }