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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DragAndDrop with different grid source

Thread ID:





128365 Jan 17,2017 10:57 AM UTC Jan 18,2017 12:56 PM UTC ASP.NET MVC 1
Tags: Grid
Asked On January 17, 2017 10:57 AM UTC

I want to drag with this grid :

@(Html.EJ().Grid<CodeLibelle>("gridmodifpresencepraticien_listeEtab" + Model.identifiantFicheCourante)
                  .Datasource(ds => ds.Json((IEnumerable<CodeLibelle>)Model.ListeEtablissementDisponible).Adaptor(AdaptorType.RemoteSaveAdaptor))
                       .RowDropSettings(d => d.DropTargetID("#gridmodifpresencepraticien" + Model.identifiantFicheCourante))
               .Columns(col =>
                   col.Field("libelle").HeaderText("Etablissements disponibles").TextAlign(TextAlign.Left).Width("160").AllowEditing(false).Add();
to this grid :

@(Html.EJ().Grid<PresencePraticien>("gridmodifpresencepraticien" + Model.identifiantFicheCourante)
                                       .Datasource(ds => ds.Json((IEnumerable<PresencePraticien>)Model.monPraticien.PRESENCES).Adaptor(AdaptorType.RemoteSaveAdaptor))
            .FilterSettings(fs => fs.FilterType(FilterType.Menu))
                                    .RowDropSettings(d => d.RowDropMapper(Url.Action("EtablissementDropHandler"new { controller = "FichePraticien", area = "Praticiens" })))
            .EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.Batch); })
            .Columns(col =>
I create this function in my controller :

public ActionResult EtablissementDropHandler(List<CodeLibelle> added)
    List<PresencePraticien> result = new List<PresencePraticien>();
    foreach (CodeLibelle myEtab in added)
        result.Add(new PresencePraticien(myEtab.code, myEtab.libelle, 0"""N"""""""));
    return Json(result, JsonRequestBehavior.AllowGet);

but my row is blank in my second grid.

anyone have an idea ?


Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On January 18, 2017 12:56 PM UTC

Hi Cholet,  
We are able to reproduce the problem at our end only if the columns in the Destination Grid doesn’t hold the Columns that are dropping into them. For instance, if the Source Grid is having OrderID Column, the column must be present in the Destination Grid, otherwise it won’t show the records. Refer to the following screenshot, which shows the Destination Grid. 
In this, OrderID, CustomerID and EmployeeID shows the values for corresponding rows but the same row doesn’t hold values for the FSE, Remplacant and Acte. Since the dropped records are not holding the values these columns, the Grid shows them blank. So we suggest to ensure whether the dropped objects contains the rendered columns. 
We have also prepared a sample that can be downloaded from the following location. 
We have also noticed that your code example is missing the IsPrimaryKey for none of the columns. IsPrimaryKey is necessary for performing the Row Drag and Drop from/to the Grid. Refer to the following code example. 
                      .Datasource(ds => ds.Json((IEnumerable<MVCSampleBrowser.Models.EditableOrder>)Model).Adaptor(AdaptorType.RemoteSaveAdaptor)) 
                    . . . 
               .Columns(col => 
                   col.Field("OrderID").IsPrimaryKey(true).HeaderText("Order ID").TextAlign(TextAlign.Left).Width("160").AllowEditing(false).Add(); 
                .Datasource(ds => ds.Json((IEnumerable<object>)ViewBag.data1).Adaptor(AdaptorType.RemoteSaveAdaptor)) 
           . . . . 
            .Columns(col => 
                     . .  
If you are still facing any problem, please share the following details to analyze your problem. 
1)      Screenshot for the problem 
2)      If possible modify the attached sample and replicate the issue. 
Seeni Sakthi Kumar S. 


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