Unplanned
Last Updated: 07 May 2024 09:30 by Martin Ivanov
Created by: Martin Ivanov
Comments: 0
Category: FilePathPicker
Type: Feature Request
0

Currently, the RadFilePathPicker control doesn't support pasting paths wrapped in quotation marks. For example: "C:\myfolder\anotherfolder\" instead you should use C:\myfolder\anotherfolder\
This mimics the Windows Explorer behavior which doesn't allow quotation marks in the paths.
Such path can be created via the "Copy as path" option in the Windows Explorer's right click context menu.

Add a mode which allows paths wrapped in quotation marks, such as the paths created with "Copy as path".

In the meantime, you can use the following customization:

public MainWindow()
{
 InitializeComponent();
 DataObject.AddPastingHandler(this.filePathPicker, OnFilePathPickerPaste);            
}

private void OnFilePathPickerPaste(object sender, DataObjectPastingEventArgs e)
{
 var isText = e.SourceDataObject.GetDataPresent(DataFormats.UnicodeText, true);
 if (isText)
 {
	 e.CancelCommand();

	 var text = (string)e.SourceDataObject.GetData(DataFormats.UnicodeText);
	 while (text.Contains('"'))
	 {                    
		 text = text.Replace("\"", string.Empty);
	 }
	 this.filePathPicker.Text = text;
 }
}