[CLOSED] Can we have drag and drop in same grid

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] Can we have drag and drop in same grid

    Hi,
    Can we have drag and drop in same grid

    Thanks
    Last edited by Daniil; Dec 23, 2010 at 3:40 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please look at the example below.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Import Namespace="System.Collections.Generic" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            List<object> data = new List<object>();
    
            for (int i = 0; i < 10; i++)
            {
                data.Add(new
                {
                    Name = "Rec " + i,
                    Column1 = i.ToString(),
                    Column2 = i.ToString()
                });
            }
    
            this.GridPanel1.GetStore().DataSource = data;
            this.GridPanel1.GetStore().DataBind();
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    
        <script type="text/javascript">
            var notifyDrop = function(ddSource, e, data) {
                var index = ddSource.grid.getView().findRowIndex(e.target),
                    store = ddSource.grid.getStore();
                store.remove(ddSource.dragData.selections);
                index = index > store.getCount() ? store.getCount() : index;
                store.insert(index, ddSource.dragData.selections);
                return true;
            };
        </script>
    
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:GridPanel 
            ID="GridPanel1" 
            runat="server" 
            Height="500"
            EnableDragDrop="true" 
            DDGroup="ddGroup">
            <Store>
                <ext:Store runat="server">
                    <Reader>
                        <ext:JsonReader>
                            <Fields>
                                <ext:RecordField Name="Name" />
                                <ext:RecordField Name="Column1" />
                                <ext:RecordField Name="Column2" />
                            </Fields>
                        </ext:JsonReader>
                    </Reader>
                </ext:Store>
            </Store>
            <ColumnModel>
                <Columns>
                    <ext:Column Header="Record Name" DataIndex="Name" />
                    <ext:Column Header="Column 1" DataIndex="Column1" />
                    <ext:Column Header="Column 2" DataIndex="Column2" />
                </Columns>
            </ColumnModel>
            <SelectionModel>
                <ext:RowSelectionModel runat="server" />
            </SelectionModel>
        </ext:GridPanel>
        <ext:DropTarget 
            runat="server" 
            Target="={GridPanel1.view.scroller.dom}" 
            Group="ddGroup">
            <NotifyDrop Fn="notifyDrop" />
        </ext:DropTarget>
        </form>
    </body>
    </html>
  3. #3
    Last edited by Daniil; Jan 12, 2012 at 8:09 PM.
  4. #4
    I'm trying to use this code... but the compiler don't recognice ext:DropTarget

    <ext:DropTarget
            runat="server"
            Target="={GridPanel1.view.scroller.dom}"
            Group="ddGroup">
            <NotifyDrop Fn="notifyDrop" />
        </ext:DropTarget>
    I'm using Ext 1.3 (MVC)
  5. #5
    Hi @inaltec,

    I have just tried the example with v1.3, it appears to be working fine.

    Is there any problem with another Ext.NET controls?

    What exactly is the compiler error?
  6. #6
    Say " compiler don't recognice ext:DropTarget" All other controlls work fine!
    Last edited by inaltec; Jul 03, 2012 at 10:55 PM.
  7. #7
    Please email your Ext.Net.dll to
    daniil at ext dot net.

    I will test.
  8. #8
    Quote Originally Posted by Daniil View Post
    Please email your Ext.Net.dll to
    daniil at ext dot net.

    I will test.
    Ok... I will send you from my personal gmail acount, because this file is 15.2 MB Size. You need to remove the ".inaltec" at the end of file.
  9. #9
    Daniil... did you get the file I send?
  10. #10
    Yes, I have got. Apologize for the delay, too busy here.

    Please also send the Ext.Net.Utilities.dll and Newtonsoft.Json.dll.
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] Grid Drag and Drop example
    By vali1993 in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 14, 2011, 2:20 PM
  2. [CLOSED] Grid to Grid Drag and Drop Questions
    By dmoore in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 15, 2011, 11:43 AM
  3. [CLOSED] Drag & Drop Rows in Grid
    By macap in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Dec 21, 2010, 9:38 AM
  4. Replies: 2
    Last Post: Mar 11, 2009, 9:59 AM
  5. Grid to grid Drag and Drop grouping issue
    By bobs in forum 1.x Help
    Replies: 0
    Last Post: Feb 10, 2009, 8:13 AM

Tags for this Thread

Posting Permissions