DxUpload.ExternalDropZoneCssSelector Property
Specifies the CSS selector of a container or HTML element wherein users can drop files to upload.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v26.1.dll
NuGet Package: DevExpress.Blazor
Declaration
[Parameter]
public string ExternalDropZoneCssSelector { get; set; }
Property Value
| Type | Description |
|---|---|
| String | The CSS selector of a container or HTML element where users can drop files. |
Remarks
Use the ExternalDropZoneCssSelector property to enable drag and drop functionality in the Upload. This property specifies the CSS selector of an external zone where users can drop files to upload.
You can also use the ExternalDropZoneDragOverCssClass to define the CSS class to be applied to the drop zone.
The following code snippet implements drag and drop functionality. Note that the code snippet uses Bootstrap classes. To render elements correctly, enable the UseBootstrapStyles option in theme settings.
<div id="overviewDemoDropZone" class="card custom-drop-zone rounded-3 w-100 m-0">
<span class="drop-file-icon mb-3"></span>
<span>Drag and Drop File Here</span>
</div>
<DxUpload Name="myFile"
UploadUrl="https://localhost:10000/api/Upload/Upload/"
ExternalDropZoneCssSelector="#overviewDemoDropZone"
ExternalDropZoneDragOverCssClass="custom-drop-zone-hover"
MaxFileSize="15000000" />
<div class="upload-validation-text info-text">
Uploads are limited to a single file up to 15 MB.
</div>
