Rename/Delete Root Folder in RadFileExplorer

4 posts, 0 answers
  1. James
    James avatar
    8 posts
    Member since:
    Nov 2010

    Posted 29 Nov 2010 Link to this post

    After looking around in some other threads and trying myself I am unable to rename or delete the top most node in the treeview. I have read that this is disabled but is there a way to enable this feature? I am currently using a custom DBContentProvidor so allowing the end user to rename the root nodes should be possible.
  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 02 Dec 2010 Link to this post

    Hello James,

    The root nodes cannot be deleted in RadFileExplorer control and this is by design and cannot be changed. In your case I recommend you to use this approach in order to achieve a similar result:
    • Hide the actual root nodes using this code:
      <script type="text/javascript">
          function OnTreeViewLoad(oTreeView, args)
          {
              for (var i = 0; i < oTreeView.get_nodes().get_count(); i++)
              {
                  var node = oTreeView.get_nodes().getNode(i);
                  node.get_element().firstChild.style.display = "none";
              }
          }
      </script>
    • The OnTreeViewLoad handler is attached to the RadTreeView's OnClientLoad event:
      RadFileExplorer1.TreeView.OnClientLoad = "OnTreeViewLoad";
    • You can hide the Line images using one of these approaches
      • Add this CSS to the page that host the RadFileExplorer: control
        <style type="text/css">
            div.RadTreeView .rtUL .rtLI .rtUL
            {
                padding-left: 0;
            }
                 
            div.RadTreeView .rtUL .rtLI .rtUL .rtLI .rtUL
            {
                padding-left: 20px;
            }
        </style>
      • Or set the RadTreeView's ShowLineImages="false" property:
        RadFileExplorer1.TreeView.ShowLineImages = false;

    For convenience I have attached a demo to the thread.

    Greetings,
    Fiko
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. James
    James avatar
    8 posts
    Member since:
    Nov 2010

    Posted 06 Dec 2010 Link to this post

    Hi Fiko,

    Thank you for your response to my query. Although the information and example provided a re very useful it does not really address the issue in hand. I don't want to hide the root folders as these are relevant to the user. The user indeed has the ability to create these root folders so hiding them is not an option. 

    Is there really nothing that can be overridden to enable the renaming/deleting of these root folders? Whilst I can understand the benefits of disabling this feature for true file explorers, I can not say the same for virtual directories created from a database.

    I look forward to your response

    James 
  5. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 09 Dec 2010 Link to this post

    Hello James,

    This behavior is by design and cannot be changed. In case that this is a major showstopper for you, you can use standalone controls (RadGrid, RadTreeView, etc.) in order to implement a replacement of the RadFileExplorer control.

    Regards,
    Fiko
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top