Hi Team,
I know that we can create a new folder in Blazor FileManager using OnModelInit and OnCreate.
But in my application, I want to have 2 buttons: 1 for New Folder and other for New file.
Is there a way to achieve it?
I have already tried using below code. But I do not get the popup for New File:
<FileManagerToolBarCustomTool><TelerikButton OnClick="@(()=>OnModelInitHandler("file"))">New File</TelerikButton>
</FileManagerToolBarCustomTool>
<FileManagerToolBarCustomTool>
<TelerikButton OnClick="@OnNewFileClicked">New File</TelerikButton>
</FileManagerToolBarCustomTool>
private void OnNewFileClicked()
{
var item = new HierarchicalFileEntry();
item.Name = $"New file";
item.Size = 0;
item.Extension = ".json";
item.Path = Path.Combine(DirectoryPath, item.Name);
item.IsDirectory = false;
item.HasDirectories = false;
}