We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Return rows dragged to another grid

Thread ID:

Created:

Updated:

Platform:

Replies:

143723 Apr 2,2019 05:06 PM UTC Apr 3,2019 10:53 AM UTC ASP.NET Web Forms 2
loading
Tags: Grid
César Alejandro Guerrero Nava
Asked On April 2, 2019 05:06 PM UTC

Hi syncfusion workers, is a pleasure write another time.

In this moment I have a question. Maybe is very easy or dumb, but here is:

I have two grids with the drag and drop function.

When I drag to another grid, I have a function that checks a condition.

The idea is when the condition is false, the rows dragged returns to the original grid.

Is there a function to do that? (like a reload only in the grid)

Thank you so much, have a nice day.

César Alejandro Guerrero Nava
Replied On April 2, 2019 05:10 PM UTC

Or there is a form to evit add rows if the condition is false?

Vignesh Natarajan [Syncfusion]
Replied On April 3, 2019 10:53 AM UTC

Hi César, 
 
Thanks for using Syncfusion products.  
 
Query: “he idea is when the condition is false, the rows dragged returns to the original grid. 
 
From your query, we understand that you need to prevent the dropping of record based on condition. We suggest you to achieve your requirement using BeforeRowDrop event of ejGrid. Refer the below code example 
 
<div style="float:left;width:50%"> 
 
          <%--  Source Grid--%> 
 
        <ej:Grid ID="OrdersGrid" runat="server" AllowPaging="True" AllowRowDragAndDrop="true" Selectiontype="Multiple"> 
            <RowDropSettings DropMapper="GridFeatures.aspx/Reordering" DropTargetID="DestGrid"/> 
            <PageSettings ShowDefaults="false" PageSize="9" EnableTemplates="true" Template="#pagerTemplate" /> 
            <EditSettings AllowEditing="true"/> 
            <Columns> 
……………………………………… 
            </Columns>            
        </ej:Grid> 
         
            </div> 
        <%--Destination Grid--%> 
 
        <div style="float:right;width:49%"> 
            <ej:Grid ID="DestGrid" runat="server" AllowPaging="True" AllowRowDragAndDrop="true" Selectiontype="Multiple"> 
                <RowDropSettings DropMapper="GridFeatures.aspx/Reordering"/> 
                <PageSettings ShowDefaults="false" PageSize="9" EnableTemplates="true" Template="#pagerTemplate" /> 
            <Columns> 
                <ej:Column Field="OrderID" HeaderText="Order ID" IsPrimaryKey="True" TextAlign="Right" Width="50" /> 
                <ej:Column Field="CustomerID" HeaderText="Customer ID" Width="70" /> 
                <ej:Column Field="EmployeeID" HeaderText="Employee ID" TextAlign="Right" Width="70" /> 
                <ej:Column Field="Freight" HeaderText="Freight" TextAlign="Right" Width="50" Format="{0:C}" /> 
            </Columns> 
            <ClientSideEvents BeforeRowDrop="beforedrop" /> 
                </ej:Grid> 
            </div> 
 
 
function beforedrop(args) { 
            if (args.draggedRecords[0].OrderID > 10003) 
                args.cancel = true;  
//prevent the default action by enabling the args.cancel 
        } 
 
Refer our API documentation for your reference 
 
 
Please get back to us if you have further queries. 
 
Regards, 
Vignesh Natarajan. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon