Skip to content

930548: Added disable the multiselect functionality in ASP core MVC File Manager component. #4027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 24, 2025
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class="control-section">
<div class="sample-container">
<!-- File Manager control declaration -->
@Html.EJS().FileManager("file").AjaxSettings(new Syncfusion.EJ2.FileManager.FileManagerAjaxSettings
{
Url ="https://ej2-aspcore-service.azurewebsites.net/api/FileManager/FileOperations",
DownloadUrl = "https://ej2-aspcore-service.azurewebsites.net/api/FileManager/Download",
UploadUrl = "https://ej2-aspcore-service.azurewebsites.net/api/FileManager/Upload",
GetImageUrl = "https://ej2-aspcore-service.azurewebsites.net/api/FileManager/GetImage"
}).AllowMultiSelection(false).ShowItemCheckBoxes(false).Render()
<!-- end of File Manager control -->
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class=" control-section">
<div class="sample-container">
<!-- File Manager control declaration -->
<ejs-filemanager id="file" allowMultiSelection="false" showItemCheckBoxes="false" >
<e-filemanager-ajaxsettings url="https://ej2-aspcore-service.azurewebsites.net/api/FileManager/FileOperations"
downloadUrl="https://ej2-aspcore-service.azurewebsites.net/api/FileManager/Download"
uploadUrl="https://ej2-aspcore-service.azurewebsites.net/api/FileManager/Upload"
getImageUrl="https://ej2-aspcore-service.azurewebsites.net/api/FileManager/GetImage">
</e-filemanager-ajaxsettings>
</ejs-filemanager>
<!-- end of File Manager control -->
</div>
</div>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions ej2-asp-core-mvc/file-manager/multiple-selection.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,31 @@ To enable range selection, you need to set the [enableRangeSelection](https://he
The output will look like the image below.

![File Manager rangeselection](./images/rangeselection.png)

## Disable Multi selection

{% if page.publishingplatform == "aspnet-core" %}

Setting the [`allowMultiSelection`](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.filemanager.filemanager.html#Syncfusion_EJ2_FileManager_FileManager_AllowMultiSelection) property to false will prevent you from selecting multiple files or folders with standard selection methods. However, you can still select multiple items if checkboxes are visible. To fully disable all multi-selection capabilities, you must also set the [`showItemCheckBoxes`](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.filemanager.filemanager.html#Syncfusion_EJ2_FileManager_FileManager_ShowItemCheckBoxes) property to false. This ensures that you cannot use checkboxes for multiple selections.

{% tabs %}
{% highlight cshtml tabtitle="CSHTML" %}
{% include code-snippet/file-manager/disablemultiselection/tagHelper %}
{% endhighlight %}
{% endtabs %}

{% elsif page.publishingplatform == "aspnet-mvc" %}

Setting the [`allowMultiSelection`](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.filemanager.filemanager.html#Syncfusion_EJ2_FileManager_FileManager_AllowMultiSelection) property to false will prevent you from selecting multiple files or folders with standard selection methods. However, you can still select multiple items if checkboxes are visible. To fully disable all multi-selection capabilities, you must also set the [`showItemCheckBoxes`](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.filemanager.filemanager.html#Syncfusion_EJ2_FileManager_FileManager_ShowItemCheckBoxes) property to false. This ensures that you cannot use checkboxes for multiple selections.

{% tabs %}
{% highlight razor tabtitle="CSHTML" %}
{% include code-snippet/file-manager/disablemultiselection/razor %}
{% endhighlight %}
{% endtabs %}

{% endif %}

The output will look like the image below.

![File Manager disable Multiselection](./images/disablemultiselection.png)