This is a migrated thread and some comments may be shown as answers.

Drag'n drop with master page

8 Answers 317 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gilles
Top achievements
Rank 1
Gilles asked on 27 Apr 2008, 07:59 PM
I would like to use RadGrid drag'n drop feature to reorder a list of items.
So I follow your sample available at http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Programming/DragAndDrop/DefaultCS.aspx
(Telerik.Web.UI.dll 2008.1.415.20)

It worked very well until I embed the grid into the content template of a master page. Then I cannot retreive the destination node in the drop event handler...

I do not understand why a master page causes this problem but the rest of the code is strictly the same :

Page without master page :

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="WithoutMasterPage.aspx.cs" Inherits="WithoutMasterPage" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!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>Page sans titre</title> 
</head> 
<body> 
    <form id="form1" runat="server"
     
        <asp:ScriptManager ID="scripManager" runat="server" /> 
         
        <telerik:RadGrid runat="server" ID="grdPendingOrders" Skin="Sunset" OnNeedDataSource="grdPendingOrders_NeedDataSource" AllowPaging="True" Width="350px" OnRowDrop="grdPendingOrders_RowDrop" AllowMultiRowSelection="true"
            <MasterTableView DataKeyNames="Id"
            </MasterTableView> 
            <ClientSettings AllowRowsDragDrop="True"
                <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" /> 
            </ClientSettings> 
        </telerik:RadGrid><asp:Label ID="LabelDestItem" runat="server" ForeColor="Red" /> 
     
    </form> 
</body> 
</html> 

Page with master page (the master page is the default template, no extra code) :

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="WithMasterPage.aspx.cs" Inherits="WithMasterPage" Title="Untitled Page" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"
 
    <asp:ScriptManager ID="scripManager" runat="server" /> 
     
    <telerik:RadGrid runat="server" ID="grdPendingOrders" Skin="Sunset" OnNeedDataSource="grdPendingOrders_NeedDataSource" AllowPaging="True" Width="350px" OnRowDrop="grdPendingOrders_RowDrop" AllowMultiRowSelection="true"
        <MasterTableView DataKeyNames="Id"
        </MasterTableView> 
        <ClientSettings AllowRowsDragDrop="True"
            <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" /> 
        </ClientSettings> 
    </telerik:RadGrid> 
     
    <asp:Label ID="LabelDestItem" runat="server" ForeColor="Red" /> 
 
</asp:Content> 

Code behind is the same for the two pages :

    protected void grdPendingOrders_NeedDataSource(object source, GridNeedDataSourceEventArgs e) { 
        List<GridItem> items = new List<GridItem>(); 
        items.Add(new GridItem(1, "Item1")); 
        items.Add(new GridItem(2, "Item2")); 
        items.Add(new GridItem(3, "Item3")); 
        this.grdPendingOrders.DataSource = items; 
    } 
 
    protected void grdPendingOrders_RowDrop(object sender, GridDragDropEventArgs e) { 
        if (e.DestDataItem != null) { 
            this.LabelDestItem.Text = "e.DestDataItem.OwnerGridID = " + e.DestDataItem.OwnerGridID; 
        } else { 
            this.LabelDestItem.Text = "e.DestDataItem is null!"
        } 
    } 
In the first case, e.DestDataItem is correctly set, in the other it's always null.

Have you got an explaination for this issue?

Thanks,

Gilles

8 Answers, 1 is accepted

Sort by
0
Accepted
Pavel
Telerik team
answered on 29 Apr 2008, 01:40 PM
Hi Gilles,

Indeed this is a known problem for the official version of the ASP.NET AJAX RadGrid when the Items Drag&Drop feature is used within a MasterPage. Our developers fixed it and it should be working properly with the latest build which you can find attached to this thread. Please try it and let us know if further problems arise.

Greetings,
Pavel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Gilles
Top achievements
Rank 1
answered on 29 Apr 2008, 09:40 PM
It works, e.DestDataItem is now properly set :

e.DestDataItem.OwnerGridID = ctl00_ContentPlaceHolder1_grdPendingOrders

Thank you very much for your helping.
0
skysailor
Top achievements
Rank 1
answered on 13 May 2008, 04:06 AM
Hi,
I experienced the same problem. And that hotfix has worked for me too. This hotfix is a trial build and I cannot release it. So I was wondering when you planned to include this fix in a release build?
Thanks,
Clayton.
0
Yavor
Telerik team
answered on 13 May 2008, 05:26 AM
Hi skysailor,

You can open a formal support ticket, and request the developer version hotfix.

Kind regards,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Scott Harford
Top achievements
Rank 1
answered on 14 Dec 2009, 05:07 PM
We are experiencing this same issue and are using a 2009 build,  We are attempting to drop a row from a radgrid located on a content page to a radtreeview located on a Master Page,  The Destination properties of the rowdropeventargs are not set.   So whats with that then. ?

Rob Love
AEC Repro
0
Yavor
Telerik team
answered on 17 Dec 2009, 10:59 AM
Hello Scott,

Can you confirm that you are using the latest version of the controls. 
 Also, you open a formal support ticket, and send us the problematic code for further review. Upon debugging it on our end, we will get back to you with additional information.


Greetings,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Martin
Top achievements
Rank 1
answered on 17 Dec 2012, 08:55 PM
Hi Yavor, I´m using the version : 2011.2.915.40 and a have the same problem, everytime that I check the DestDataItem
is null, I was reading but i could see that you was talking about the version 2008 and 2009 but the problem continue for me.
0
Maria Ilieva
Telerik team
answered on 20 Dec 2012, 01:15 PM
Hello Martin,

As this thread is rather old I would suggest you to provide some additional information of the scenario you are implementing and the exact issue you are facing. It will be bets if you could open a regular support ticket and send us the required information so that we could further research on the issue and provide proper solution.

Regards,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Gilles
Top achievements
Rank 1
Answers by
Pavel
Telerik team
Gilles
Top achievements
Rank 1
skysailor
Top achievements
Rank 1
Yavor
Telerik team
Scott Harford
Top achievements
Rank 1
Martin
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or