Drag and Drop from FileExplorer to RadGrid

3 posts, 0 answers
  1. Brandon
    Brandon avatar
    5 posts
    Member since:
    Mar 2014

    Posted 11 Apr 2014 Link to this post

    Is there a way for me to drag and nodes from the file explorer to a radgrid?  I would then handle the event and add a new item to the radgrid based on the current dropped object.
  2. Brandon
    Brandon avatar
    5 posts
    Member since:
    Mar 2014

    Posted 14 Apr 2014 Link to this post

  3. DevCraft R3 2016 release webinar banner
  4. Vessy
    Vessy avatar
    1354 posts

    Posted 16 Apr 2014 Link to this post

    Hi Brandon,

    In order to achieve the desired functionality with the FileExplorer's nested Grid you will need to go through the following steps:
    • Add a handler to the FileExplorer's nested grid's Client-side RowDropping event
      function OnClientLoad(explorer, args) {
    • In its event handler access the name and length (size) of the dragged file item and set them as values of two hidden fields on the page. Here you should also made an ajax request in which handler to update the content of the additional grid width these values.
      <asp:HiddenField ID="HiddenField1" runat="server" />
      <asp:HiddenField ID="HiddenField2" runat="server" />
          function grid_onRowDropping(grid, args) {
              var dataItem = args.get_draggedItems()[0].get_dataItem();
              $get("FileNameField").value = dataItem.Name;
              $get("FileSizeField").value = dataItem.Extension ? dataItem.Length : "";
    • Add the additional Grid as an updated control of the AjaxManager:
      <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1" OnAjaxRequest="radAjax_AjaxRequest">
              <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                      <telerik:AjaxUpdatedControl ControlID="externalGrid"></telerik:AjaxUpdatedControl>

    I am attaching a basic implementation of the described approach to this message. Please, feel free to modify it in order to fit your scenario best. You can also find useful information about RadGrid row dragging in following demo: Grid - Items Drag-and-drop


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top