How do I disable or remove the New Folder button in OpenFileDialog?
1 Answer, 1 is accepted
answered on 24 May 2021, 10:38 AM
Thank you for your interest in our FileDialogs for WPF.
You can hide the new folder button by manually set its Visibility property to Collapsed. You can subscribe to the Loaded event of the RadOpenFileDialog. Then you can get the button using our ChildrenOfType<T>() extension method. Check the following code snippet.
RadOpenFileDialog openFileDialog = new RadOpenFileDialog
InitialDirectory = @"C:\Temp\TestFileDialogs"
openFileDialog.Loaded += SaveFileDialog_Loaded;
privatevoidSaveFileDialog_Loaded(object sender, RoutedEventArgs e)
var saveFileDialog = sender as RadOpenFileDialog;
var button = saveFileDialog.ChildrenOfType<RadButton>().FirstOrDefault(x => x.Name == "NewFolderButton");
button.Visibility = Visibility.Collapsed;