-1

I want to switch from one datagrid to another datagrid on the single click of a button. Please provide solution.

these are my two datagrids.

<mx:AdvancedDataGrid id="dg_class" x="0" y="0" ..>

<mx:AdvancedDataGrid id="dg" x="0" y="0" ..>
ketan
  • 19,129
  • 42
  • 60
  • 98

1 Answers1

0

I don´t know if I understood correctly but let´s try

button.addEventListener(MouseEvent.CLICK, toggleGrids);

function toggleGrids(e:MouseEvent):void{
      dg_class.visible = !dg_class.visible;
      dg.visible = !dg_class.visible;
}
codingbuddha
  • 707
  • 5
  • 16
  • no its not working.... what actually i need to do is currently my "dg" grid is displaying. now when i click on display button "Dg_class" grikd should appear. – akshat.jain2731 May 07 '13 at 08:52
  • I just built a small fla and tested it. And it works fine here. You press the button, one appears and the other disappears. – codingbuddha May 07 '13 at 08:58