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".
ADAdministrator Syncfusion Team September 11, 2003 03:04 PM
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.
NVNik ValeSeptember 15, 2003 09:20 AM
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 Settingsvale\My Documents\" instead (see attachment).
Thanks for you help.
ADAdministrator Syncfusion Team September 16, 2003 06:15 AM
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.