7 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 20 Jun 2012, 09:51 AM
Hi Ashish,
Following is the sample code that I tried based on your scenario.
ASPX:
C#:
Hope this helps.
Thanks,
Princy.
Following is the sample code that I tried based on your scenario.
ASPX:
<
telerik:RadFileExplorer
ID
=
"RadFileExplorer1"
runat
=
"server"
Height
=
"300px"
Width
=
"804px"
Skin
=
"Forest"
>
<
Configuration
SearchPatterns
=
"*.*"
UploadPaths
=
"~/exercise/"
ViewPaths
=
"~/exercise/"
DeletePaths
=
"~/exercise/"
>
</
Configuration
>
</
telerik:RadFileExplorer
>
C#:
protected
void
Page_Load(
object
sender, EventArgs e)
{
RadFileExplorer1.Configuration.ContentProviderTypeName =
typeof
(CustomProvider).AssemblyQualifiedName;
}
public
class
CustomProvider : FileSystemContentProvider
{
public
CustomProvider(HttpContext context,
string
[] searchPatterns,
string
[] viewPaths,
string
[] uploadPaths,
string
[] deletePaths,
string
selectedUrl,
string
selectedItemTag)
:
base
(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, selectedItemTag)
{ }
public
override
DirectoryItem ResolveRootDirectoryAsTree(
string
path)
{
DirectoryItem originalDir =
base
.ResolveRootDirectoryAsTree(path);
string
physicalPath = Context.Server.MapPath(path);
List<DirectoryItem> childDirItems =
new
List<DirectoryItem>();
foreach
(DirectoryItem currentDir
in
originalDir.Directories)
{
string
physicalPathChildFile = Context.Server.MapPath(currentDir.FullPath);
DirectoryItem childDirItem =
new
DirectoryItem(currentDir.Name +
"("
+ Directory.GetFiles(physicalPathChildFile).Length +
")"
,
currentDir.Location,
currentDir.FullPath,
currentDir.Tag,
currentDir.Permissions,
currentDir.Files,
currentDir.Directories
);
childDirItems.Add(childDirItem);
}
DirectoryItem dirItem =
new
DirectoryItem(originalDir.Name +
"("
+ Directory.GetFiles(physicalPath).Length +
")"
,
originalDir.Location,
originalDir.FullPath,
originalDir.Tag,
originalDir.Permissions,
originalDir.Files,
childDirItems.ToArray()
);
return
dirItem;
}
public
override
DirectoryItem ResolveDirectory(
string
path)
{
DirectoryItem originalDir =
base
.ResolveDirectory(path);
string
physicalPath = Context.Server.MapPath(path);
DirectoryItem dirItem =
new
DirectoryItem(originalDir.Name +
"("
+ Directory.GetFiles(physicalPath).Length +
")"
,
originalDir.Location,
originalDir.FullPath,
originalDir.Tag,
originalDir.Permissions,
originalDir.Files,
originalDir.Directories
);
return
dirItem;
}
}
Hope this helps.
Thanks,
Princy.
0
Ashish
Top achievements
Rank 1
answered on 20 Jun 2012, 02:30 PM
Thanks, Princy for your reply.
Now my another question is, can we show total count in footer just like windows file explorer as shown in the attached file?
0
Hello Ashish,
When paging is enabled in the FileExplorer, the number of items in a folder is shown. Here is a link to a demo showing this: http://demos.telerik.com/aspnet-ajax/fileexplorer/examples/server-sideapi/initialpathandpaging/defaultcs.aspx.
Greetings,
Pero
the Telerik team
When paging is enabled in the FileExplorer, the number of items in a folder is shown. Here is a link to a demo showing this: http://demos.telerik.com/aspnet-ajax/fileexplorer/examples/server-sideapi/initialpathandpaging/defaultcs.aspx.
Greetings,
Pero
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.
0
Ashish
Top achievements
Rank 1
answered on 25 Jun 2012, 09:07 AM
Actually as per our requirement we don't want paging for that, we just need to show file count? is it possible without paging?
0
Hi,
You can disable the paging by setting AllowPaging="false" but this will hide the file count statistics.
Best regards,
Rumen
the Telerik team
You can disable the paging by setting AllowPaging="false" but this will hide the file count statistics.
Best regards,
Rumen
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.
0
Ashish
Top achievements
Rank 1
answered on 10 Jul 2012, 01:27 PM
Hello Rumen,
I think you didn't get my question. I want to disable paging, which i had did as you said. But i also want to show file count, which is not appearing after disabling paging. So any work around here?
I think you didn't get my question. I want to disable paging, which i had did as you said. But i also want to show file count, which is not appearing after disabling paging. So any work around here?
0
Ashish
Top achievements
Rank 1
answered on 16 Jul 2012, 01:16 PM
Hello Princy,
I have applied solution you have suggested. But After uploading/deleting file in directory, counter did not get update? Is there any solution around this?
I have applied solution you have suggested. But After uploading/deleting file in directory, counter did not get update? Is there any solution around this?