We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

FolderBrowser initial selection

Thread ID:

Created:

Updated:

Platform:

Replies:

7087 Sep 11,2003 03:33 PM UTC Sep 16,2003 11:15 AM UTC Windows Forms 3
loading
Tags: Tools
Nik Vale
Asked On September 11, 2003 03:33 PM UTC

I am doing the following to set the initial selection... private void InternalFolderBrowserCallback(object sender, Syncfusion.Windows.Forms.FolderBrowserCallbackEventArgs e) { // On initialization set the inital directory... if(e.FolderBrowserMessage == FolderBrowserMessage.Initialized && m_initialDirectory != null) { e.FolderBrowserCallbackSetState = FolderBrowserCallbackSetState.SetSelection; e.BrowseCallbackText = m_initialDirectory; } } However, I am unable to set the initial selection to "My Documents" (under Desktop). I can only ever set it to "C:\Documents and Settings\\My Documents". Any ideas?

Administrator [Syncfusion]
Replied On September 11, 2003 08:04 PM UTC

Hi Nik, Please take a look at the FolderBrowserDemo sample in the \Syncfusion\Essential Suite\Shared\Samples\FolderBrowserDemo\CS directory. If you look through the code, you will find that to set the StartLocation to 'MyDocuments' on the Desktop, you will have to use FolderBrowserFolder.Personal enumeration value. Programmatically you could do it by using the following code : this.folderBrowser1.StartLocation = FolderBrowserFolder.Personal; Please let me know if this helps. Regards, Guru Patwal.

Nik Vale
Replied On September 15, 2003 02:20 PM UTC

Thanks for directing me to the sample. However, it is not the StartLocation I am trying to change it is the initial selection. I want the StartLocation to be the Desktop but I would like the "My Documents" folder to be selected and expanded (see attachment). The code I posted previously allows the initial selection to be set but it always selects "C:\Documents and Settings\nvale\My Documents\" instead (see attachment). Thanks for you help.

Administrator [Syncfusion]
Replied On September 16, 2003 11:15 AM UTC

Hi Nik, Sorry for having wrongly interpreted your question earlier. Setting the initial selection to "MyDocuments" maps to the CSIDL_MYDOCUMENTS CSIDL value and that as per the Shell docs, represents the logical "My Documents" desktop icon. Accessing the virtual "My Documents" folder involves accessing the PIDL through the desktop’s IShellFolder interface and the FolderBrowser component is currently restricted to the ::SHGetSpecialFolderLocation() API that uses the CSIDL values. We have an open feature request(QA# 118) on this issue and we will do our best to support this functionality in a future version of Essential Tools. Thanks for your patience. Regards, Guru Patwal.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;