RadControls version
|
RadFileExplorer for ASP.NET AJAX from Q3 2012 |
.NET version |
3.5 / 4.0 / 4.5 |
Visual Studio version |
2008/ 2010/ 2012 |
programming language |
C# / VB.NET |
browser support |
all browsers supported by RadControls
|
PROJECT DESCRIPTION
How to apply changes to the files on the current loaded in FileExplorer folder page by page.
PROJECT DESCRIPTION
In order to apply changes only to the files on the current page we need information about the current page, as well as for the set FileExplorer's PageSize.
The start index of the first item on the current page is given as a parameter in the CallBack response - it could be accessed in the following way:
C#
VB
After that, we will
subclass the existing FileSystemContentProvider by overriding the
ResolveDirectory() method:
C#
VB
Public
Overrides
Function
ResolveDirectory(path
As
String
)
As
DirectoryItem
'Access the files from the current directory
Dim
orgDir
As
DirectoryItem =
MyBase
.ResolveDirectory(path)
'Access the nested directories from the current one
Dim
orgDir2
As
DirectoryItem = ResolveRootDirectoryAsTree(path)
'Get a reference to the page
Dim
_pageContainsRadFileExplorer
As
Page = TryCast(HttpContext.Current.Handler, Page)
Dim
fileExplorer
As
RadFileExplorer = TryCast(_pageContainsRadFileExplorer.FindControl(
"RadFileExplorer1"
), RadFileExplorer)
Dim
dirCount
As
Integer
= orgDir2.Directories.Length
Dim
pageSize
As
Integer
= fileExplorer.FileList.PageSize
Dim
index
As
Integer
= dirCount
For
Each
file
As
FileItem
In
orgDir.Files
If
index > startIndex + pageSize
Then
Exit
For
End
If
If
startIndex < dirCount
AndAlso
index < dirCount
Then
index = dirCount
End
If
'A little visible change to the files
file.Name = index.ToString() +
"_"
+ file.Name
'A custom file-change logic could be implemented here
index += 1
Next
Return
orgDir
End
Function
THE RESULT
The subsequent number of every file is added to its name.