Grid Property is null

4 posts, 0 answers
  1. JohnA
    JohnA avatar
    12 posts
    Member since:
    Jan 2006

    Posted 02 Sep 2014 Link to this post


    I am using the latest released version of the control.  In Page_Load I have the following code:

    RadFileExplorer1.TreeView.EnableDragAndDrop = true;
    RadFileExplorer1.Grid.ClientSettings.AllowRowsDragDrop = true;

    It fails on the second line because the .Grid property is null at that point?    If I don't have that code the program seems to run fine.


    For reference, I added the above code to the bottom of Page_Load in the program "PhysicalPathFileSystemProvider_Cs.zip"

    located at the bottom of the page on http://www.telerik.com/support/kb/details/use-radfileexplorer-with-physical-and-shared-folder-s-paths



  2. Vessy
    Admin
    Vessy avatar
    1385 posts

    Posted 05 Sep 2014 Link to this post

    Hi John,

    I tested the described by you problem, but I was able to get a proper reference to the RadGrid object in the Page_Load event-handler. I made my tests with the project provided in this KB article. Could you please provide more details regarding the specific scenario? Are there any other customizations on the page where the problem occurs?

    Please, note also that by design the dragging in FileExplrorer is enabled and the user is able to drag files from the grid to the tree. In case you want to disable this functionality you can follow the approach described in this forum tread: Disable Drag-Drop not working

    Regards,
    Vessy
    Telerik
     

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. JohnA
    JohnA avatar
    12 posts
    Member since:
    Jan 2006

    Posted 05 Sep 2014 in reply to Vessy Link to this post

    Thanks for the reply Vessy.

    I started from scratch again to duplicate and I missed one line of code in my prior post, here is exactly what I did the second time

    Open as website from file system in VS 2013 Update 2
    Switch project to 4.5.2
    Add references to local Telerik 4.5 DLL's, Telerik.Web.UI.DLL, Telerik.Web.UI.Skins.DLL, both  Q2 2014 SP1
    Run, modify web.config to support debugging, yes
    Runs OK

    add 

    RadFileExplorer1.ExplorerMode = Telerik.Web.UI.FileExplorer.FileExplorerMode.Default;
    RadFileExplorer1.TreeView.EnableDragAndDrop = false;
    RadFileExplorer1.Grid.ClientSettings.AllowDragToGroup = true;

    to bottom of Page_Load, will fails on the 3rd newly added line, because Grid property is null.



  5. Vessy
    Admin
    Vessy avatar
    1385 posts

    Posted 10 Sep 2014 Link to this post

    Hi John,

    Thank you for the detailed explanation. I managed to reproduce the described behavior. After a further investigation it turned out to be connected with the moment the visibility state of the Grid is set when the FileExplorer's Explorer mode is configured explicitly. I have logged this behavior as a bug which progress can be tracked here: feedback item.

    Basically, moving the Grid-related logic to the Page PreRenderComplete event handler will fix the issue, as the Grid will be made visible at this point:
    protected void Page_PreRenderComplete(object sender, EventArgs e)
    {
        RadFileExplorer1.Grid.ClientSettings.AllowDragToGroup = true;
    }

    I have also updated your Telerik points as a small token of gratitude for the reported issue.

    Kind regards,
    Vessy
    Telerik
     

    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