title | description | type | page_title | slug | position | tags | res_type |
---|---|---|---|---|---|---|---|
Open a RadOpenFileDialog when Using the RadCloudUpload |
Replace the Default OpenFileDialog when Browsing Files. |
how-to |
Use a RadOpenFileDialog to Select the Files to be Uploaded |
kb-cloudupload-howto-show-radfileopendialog |
0 |
cloudupload, replace, openfiledialog |
kb |
Product | RadCloudUpload for WPF |
How to replace the default MS OpenFileDialog with a [RadOpenFileDialog]({%slug radfiledialogs-radopenfiledialog%}).
Handle the AddingFiles event of the RadCloudUpload control, cancel the creation of the default dialog with the CancelDialogOpening property, open a new RadOpenFileDialog and populate the FileNames collection with the files, selected in the dialog.
{{region cs-kb-cloudupload-howto-show-radfileopendialog-1}} private void RadCloudUpload_AddingFiles(object sender, AddingFilesEventArgs e) { e.CancelDialogOpening = true;
if (fileDialog == null)
{
fileDialog = new RadOpenFileDialog();
fileDialog.Multiselect = true;
}
if (fileDialog.ShowDialog() == true)
{
foreach (var file in fileDialog.FileNames)
{
e.FileNames.Add(file);
}
}
}
{{endregion}}
{{region vb-kb-cloudupload-howto-show-radfileopendialog-1}} Private Sub RadCloudUpload_AddingFiles(ByVal sender As Object, ByVal e As AddingFilesEventArgs) e.CancelDialogOpening = True
If fileDialog Is Nothing Then
fileDialog = New RadOpenFileDialog()
fileDialog.Multiselect = True
End If
If fileDialog.ShowDialog() = True Then
For Each file In fileDialog.FileNames
e.FileNames.Add(file)
Next file
End If
End Sub
{{endregion}}
- [RadCloudUpload Eventts]({%slug radcloudupload-features-events%})
- [RadOpenFileDialog]({%slug radfiledialogs-radopenfiledialog%})