[Solved] RadOpenFileDialog select initial file

1 Answer 8 Views
FileDialogs
Luigi
Top achievements
Rank 3
Bronze
Iron
Iron
Luigi asked on 16 Feb 2026, 04:11 PM
Hi,
I open a RadOpenFileDialog  setting FileName with the full path of an existing file.
In the edit box in the low part of dialog I can see the path, and, if I click ok I get the file selected.
But in the list of files the path is not selected (the folder is also correctly set).

How can I select correctly the file and automatic scroll the view in order to see the seelction

Thank you
Luigi

1 Answer, 1 is accepted

Sort by
0
Stenly
Telerik team
answered on 19 Feb 2026, 11:09 AM

Hello Luigi,

The RadFileDialogs component does not provide this functionality out of the box, however, it can be achieved with a bit of custom logic.

More specifically, you could subscribe to the Loaded event of the RadOpenFileDialog instance and retrieve the FileBrowserListBox element via the ChildrenOfType extension method. Then, check if its items contain a file that matches the one that is set on the FileName property of RadOpenFileDialog. If there is, retrieve it and set it to the SelectedItem property of the FileBrowserListBox element.

The following code snippet showcases this suggestion's implementation:

private void OpenFileDialog_Loaded(object sender, RoutedEventArgs e)
{
	RadOpenFileDialog openFileDialog = (RadOpenFileDialog)sender;

	FileBrowserListBox fileBrowserListBox = openFileDialog.ChildrenOfType<FileBrowserListBox>().FirstOrDefault();

	if (fileBrowserListBox != null)
	{
		FileSystemInfoWrapper selectedFileSystemInfoWrapper = fileBrowserListBox.ItemsSource
			.Cast<FileSystemInfoWrapper>()
			.Where(x => openFileDialog.FileName.Contains(x.Name))
			.FirstOrDefault();

		if (selectedFileSystemInfoWrapper != null)
		{
			fileBrowserListBox.SelectedItem = selectedFileSystemInfoWrapper;
		}
	}
}

With this being said, I attached a sample project for you to test, which contains this suggestion's implementation.

Regards,
Stenly
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
FileDialogs
Asked by
Luigi
Top achievements
Rank 3
Bronze
Iron
Iron
Answers by
Stenly
Telerik team
Share this question
or