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

Grid Property is null

3 Answers 64 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
JohnA
Top achievements
Rank 1
JohnA asked on 02 Sep 2014, 02:23 PM

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



3 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 05 Sep 2014, 02:36 PM
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.

 
0
JohnA
Top achievements
Rank 1
answered on 05 Sep 2014, 03:28 PM
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.



0
Vessy
Telerik team
answered on 10 Sep 2014, 01:44 PM
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.

 
Tags
FileExplorer
Asked by
JohnA
Top achievements
Rank 1
Answers by
Vessy
Telerik team
JohnA
Top achievements
Rank 1
Share this question
or