3 Replies Latest reply on Feb 8, 2008 12:28 PM by ntsiii

    Drag and drop in datagrid

    trycold Level 1
      Hi,

      I have 3 datagrids. Data from 2 datagrids I want to drag to the third one.
      Datagrid #1
      <mx:DataGrid id="DG1" width="100%" height="100%"
      dataProvider="{typesAC}" headerHeight="18"
      sortableColumns="true" rowHeight="24"
      variableRowHeight="false" wordWrap="true" dragEnabled="true"
      >
      <mx:columns>
      <mx:DataGridColumn dataField="typeName" headerText="Name" />
      <mx:DataGridColumn dataField="typeDesc headerText="Description" />
      </mx:columns>
      </mx:DataGrid>

      DG #2
      <mx:DataGrid id="DG2" width="100%" height="100%"
      headerHeight="18"
      sortableColumns="true" rowHeight="24"
      variableRowHeight="false" wordWrap="true" dragEnabled="true" >
      <mx:columns>
      <mx:DataGridColumn dataField="formName" />
      </mx:columns>
      </mx:DataGrid>

      What I want is is the the datagrid #3 have data combined of both. Means it should have colums like:

      <mx:DataGrid width="100%" id="DG3" dropEnabled="true"
      dataProvider="{}">
      <mx:columns>
      <mx:DataGridColumn dataField="typeDesc" />
      <mx:DataGridColumn dataField="formName" />
      </mx:columns>
      </mx:DataGrid>

      It drags fine. But it puts the data in the next row. if I am dragging typeDesc from DG1 and formName from DG2. I want it to be in the same row. How can i do it? if I drag from one grid and from the second instead of adding another row I want to add data in the same row.

      Thanks