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

RadTreeList Drag and Drop

3 Answers 143 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Mohamed Salah Al-Din
Top achievements
Rank 1
Mohamed Salah Al-Din asked on 27 Oct 2011, 04:16 PM
Dear Sir,
    I need an example of using drag and drop items but without using detailed template with a simple radtreelist, because i tried to implement it but i faced some problems with the interface.with scrolling and treelist height = 100% and width=100%, but when i drag a row it shows the height of the selected row = 100% also. please i need your help in this issue.
<telerik:RadTreeList ID="rtl_Category" runat="server" SkinID="Default_RadTreeList_Skin" AllowPaging="false" Width="100%" Height="100%" EnableNoRecordsTemplate="true" Dir='<%$ Resources:Common,res_Direction %>'
        DataKeyNames="ID" ClientDataKeyNames="ID,ParentCategory.ID" ParentDataKeyNames="ParentCategory.ID" AutoGenerateColumns="False" OnNeedDataSource="rtl_Category_NeedDataSource" >
        <ClientSettings AllowItemsDragDrop="true">
            <ClientEvents OnItemDropping="itemDropping" OnItemDragging="itemDragging" OnTreeListCreated="function(sender) { treeList2 = sender; }"  />
            <Selecting AllowItemSelection="True"  />
            <Scrolling AllowScroll="true" UseStaticHeaders="true" ></Scrolling>
        </ClientSettings>
        <Columns>
            <telerik:TreeListBoundColumn DataField="ID" HeaderText="ID" UniqueName="ID"
                ReadOnly="true" />
            <telerik:TreeListBoundColumn DataField="Title" HeaderText="Title" UniqueName="Title"/>
            <telerik:TreeListBoundColumn DataField="Description" HeaderText="Description" UniqueName="Description" />
            <telerik:TreeListDateTimeColumn DataField="CreatedOn" HeaderText="CreatedOn" UniqueName="CreatedOn"/>
            <telerik:TreeListBoundColumn DataField="CreatedBy.UserName" HeaderText="CreatedBy" UniqueName="CreatedBy" />
            <telerik:TreeListBoundColumn DataField="ParentCategory.ID" HeaderText="Parent" UniqueName="ParentCategory" Visible="false"/>
        </Columns>
        <NoRecordsTemplate>
            <table width="100%" cellpadding="0" cellspacing="0" border="0" style="height: 40px;
                border-collapse: collapse; border: solid 1px #dddddd;">
                <tr>
                    <td align="center" valign="middle">
                        <asp:Label ID="lbl_GRD_NoRecords" runat="server" Text="No Records Found"></asp:Label>
                    </td>
                </tr>
            </table>
        </NoRecordsTemplate>
    </telerik:RadTreeList>

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 28 Oct 2011, 07:31 AM
Hello Mohamed,

Take a look at the following demo.
TreeList / Items Drag and Drop.

Thanks,
Shinu.
0
Mohamed Salah Al-Din
Top achievements
Rank 1
answered on 30 Oct 2011, 10:26 AM
Dear Shinu,
    First thanks for your replay, i want to tell you that i already know that demo http://demos.telerik.com/aspnet-ajax/treelist/examples/itemsdragdrop/defaultcs.aspx, but this one uses DetailedTemplate, which specify width and height to the item.but in my case i want more simple one without detailed template and with scrolling and the treelist width and height = 100%.

becuase i tried to emplement this case but it caused the dragged item to have height of 100% as well as the treelist, that's way i think this is an error in the control it self.

Best Regards,    
 Mohamed Salah Al-Din
0
Accepted
Daniel
Telerik team
answered on 03 Nov 2011, 01:16 PM
Hello Mohamed,

Please try the following code and see if this helps:
<script type="text/javascript">
    function itemDragging(sender, args)
    {
        if (args.get_draggedContainer().style.height.indexOf("%") != -1)
            args.get_draggedContainer().style.height = "";
    }
</script>

Kind regards,
Daniel
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
TreeList
Asked by
Mohamed Salah Al-Din
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Mohamed Salah Al-Din
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or