<ej:TreeGrid runat="server" ID="TreeGridControlDragAndDrop" ChildMapping="SubTasks" TreeColumnIndex="1" IsResponsive="true" AllowDragAndDrop="true" >
<columns>
<ej:TreeGridColumn HeaderText="Task Id" Field="taskID" Width="45" EditType="Numeric" AllowFiltering="false"/>
<ej:TreeGridColumn HeaderText="Task Name" Field="taskName" EditType="String" FilterEditType="String" ShowCheckbox="true"/>
. . .
</columns>
</ej:TreeGrid>
<ej:Grid ID="EmployeesGrid" runat="server" AllowPaging="true" AllowRowDragAndDrop="true">
<ClientSideEvents RowDrop="rowDropHandler" />
<Columns>
<ej:Column Field="taskID" IsPrimaryKey="true" HeaderText="Order ID" Width="100"/>
<ej:Column Field="taskName" HeaderText="Task Name" Width="100">
</ej:Column>
<ej:Column Field="startDate" HeaderText="Start Date" Format="{0:MM/dd/yyyy}" Width="100" > </ej:Column>
. . .
</Columns>
</ej:Grid>
<script>
function rowDropHandler(args){
var treeGridObj = $("#MainContent_TreeGridControlDragAndDrop").data("ejTreeGrid"); // take the ejTreeGrid instance
treeGridObj.addRow(args.data[0], ej.TreeGrid.RowPosition.Child); // add the record to treeGrid using addRow() method of ejTreeGrid
this.deleteRow()
}
</script> |