1 Reply Latest reply on Oct 27, 2009 4:41 AM by appdevs

    Scrolling two data grids together in Flex 3

    appdevs

      I have two data grids side by side in a Canvas.When I scroll one data grid, the other data grid should automatically move alongwith the first one.

      Can anyone let me know how that can be done?I am using the vertical scroll bar

       

      Thanks!

       

       

      Code Snippet:

       

       

       

       

       

      <mx:Canvas

       

       

       

      label="Canvas 1" width="100%" height="100%" >

          <mx:DataGrid id="goldServerdg" height ="100%" width="297" dataProvider="{compareXML}">

                <mx:columns>

                    <mx:DataGridColumn id="variable1Col" dataField="@srcVariable" headerText="Variable Name" itemRenderer="ColorCode" />

                    <mx:DataGridColumn id="value1Col" dataField="@srcValue" headerText="Value" itemRenderer="ColorCode"/>

                </mx:columns>

          </mx:DataGrid>

          <mx:DataGrid id="cmpServerdg" height="100%" width="313" dataProvider="{compareXML}" >

                <mx:columns >

                     <mx:DataGridColumn id="variable2Col" dataField="@tgtVariable" headerText="Variable Name" itemRenderer="ColorCode" />

                     <mx:DataGridColumn id="value2Col" dataField="@tgtValue" headerText="Value" />

                </mx:columns>

           </mx:DataGrid>

      </mx:Canvas>