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

TreeView control

Thread ID:

Created:

Updated:

Platform:

Replies:

15107 Jun 11,2004 04:43 AM UTC Jun 17,2004 09:12 AM UTC Windows Forms 7
loading
Tags: Tools
Satish
Asked On June 11, 2004 04:43 AM UTC

Hi Guru, I have requirment something very very similar to Explorer. We’d like an entry to be added to the treeview and for the user to type in the some name into the treeview section (something similar to what happens in the explorer program when a new folder is created). If the somename is valid, then it needs to be store into database. Validation for somename would be same as creation a new file in the explorer. I would like to check, whether this name exists in the tree already if it exists throw an error message to change the somename to other. Do you have any sample something very similar? Thanks Satish

Administrator [Syncfusion]
Replied On June 11, 2004 08:12 PM UTC

Hi Satish, Please take a look at the sample in the directory ...\Syncfusion\Essential Suite\2.0.5.1\Tools\Samples\Tree Package\TreeViewAdvOwnerDraw. The TreeViewAdv has to be targetted to a particular directory in the disk and then manually populated as shown in the code below : private void treeViewAdv2_BeforeExpand(object sender, Syncfusion.Windows.Forms.Tools.TreeViewAdvCancelableNodeEventArgs e) { if(e.Node.ExpandedOnce) return; string path = e.Node.GetPath("\\"); ArrayList dirs = new ArrayList(Directory.GetDirectories(path)); for(int i=0;i0) TreeNodeAdv node = new TreeNodeAdv(dir.Substring(lastIndex)); e.Node.Nodes.Add(node); } } Please refer to it and let me know if this meets your requirements. Regards, Guru Patwal Syncfusion,Inc.

Satish
Replied On June 14, 2004 09:18 AM UTC

Hi Guru, Please find the application and the document. Thanks Satish >Hi Satish, > >Please take a look at the sample in the directory ...\Syncfusion\Essential Suite\2.0.5.1\Tools\Samples\Tree Package\TreeViewAdvOwnerDraw. The TreeViewAdv has to be targetted to a particular directory in the disk and then manually populated as shown in the code below : > >private void treeViewAdv2_BeforeExpand(object sender, Syncfusion.Windows.Forms.Tools.TreeViewAdvCancelableNodeEventArgs e) > { > if(e.Node.ExpandedOnce) return; > > string path = e.Node.GetPath("\\"); > ArrayList dirs = new ArrayList(Directory.GetDirectories(path)); > for(int i=0;i { > string dir = (string)dirs[i]; > int lastIndex = dir.LastIndexOf("\\")+1; > // if(lastIndex <=0) lastIndex = dir.LastIndexOf(":")+1; > // if(lastIndex>0) > TreeNodeAdv node = new TreeNodeAdv(dir.Substring(lastIndex)); > e.Node.Nodes.Add(node); > } > } > >Please refer to it and let me know if this meets your requirements. > >Regards, >Guru Patwal >Syncfusion,Inc. TreeViewWithContextMenu_4970.zip

Administrator [Syncfusion]
Replied On June 15, 2004 12:11 PM UTC

Hi Satish, You can achieve what you require using Syncfusion popupmenus instead of context menus. TreeViewCancelPopUpForums_1914.zip Please take a look at the sample and let me know if you have any questions. Thanks. Best regards, Stephen. >Hi Guru, >Please find the application and the document. >Thanks >Satish > > > >>Hi Satish, >> >>Please take a look at the sample in the directory ...\Syncfusion\Essential Suite\2.0.5.1\Tools\Samples\Tree Package\TreeViewAdvOwnerDraw. The TreeViewAdv has to be targetted to a particular directory in the disk and then manually populated as shown in the code below : >> >>private void treeViewAdv2_BeforeExpand(object sender, Syncfusion.Windows.Forms.Tools.TreeViewAdvCancelableNodeEventArgs e) >> { >> if(e.Node.ExpandedOnce) return; >> >> string path = e.Node.GetPath("\\"); >> ArrayList dirs = new ArrayList(Directory.GetDirectories(path)); >> for(int i=0;i> { >> string dir = (string)dirs[i]; >> int lastIndex = dir.LastIndexOf("\\")+1; >> // if(lastIndex <=0) lastIndex = dir.LastIndexOf(":")+1; >> // if(lastIndex>0) >> TreeNodeAdv node = new TreeNodeAdv(dir.Substring(lastIndex)); >> e.Node.Nodes.Add(node); >> } >> } >> >>Please refer to it and let me know if this meets your requirements. >> >>Regards, >>Guru Patwal >>Syncfusion,Inc. > >TreeViewWithContextMenu_4970.zip > >

Satish
Replied On June 16, 2004 01:10 AM UTC

Hi Stephen, Thanks for your sample. Example was quick impressive but I cannot use the syncfusion popup''s as i am already using Context Menu''s. Is there any way with Context Menu to implment the same thing. Thanks Satish >Hi Satish, > >You can achieve what you require using Syncfusion popupmenus instead of context menus. > >TreeViewCancelPopUpForums_1914.zip > >Please take a look at the sample and let me know if you have any questions. Thanks. > >Best regards, > >Stephen. > >>Hi Guru, >>Please find the application and the document. >>Thanks >>Satish >> >> >> >>>Hi Satish, >>> >>>Please take a look at the sample in the directory ...\Syncfusion\Essential Suite\2.0.5.1\Tools\Samples\Tree Package\TreeViewAdvOwnerDraw. The TreeViewAdv has to be targetted to a particular directory in the disk and then manually populated as shown in the code below : >>> >>>private void treeViewAdv2_BeforeExpand(object sender, Syncfusion.Windows.Forms.Tools.TreeViewAdvCancelableNodeEventArgs e) >>> { >>> if(e.Node.ExpandedOnce) return; >>> >>> string path = e.Node.GetPath("\\"); >>> ArrayList dirs = new ArrayList(Directory.GetDirectories(path)); >>> for(int i=0;i>> { >>> string dir = (string)dirs[i]; >>> int lastIndex = dir.LastIndexOf("\\")+1; >>> // if(lastIndex <=0) lastIndex = dir.LastIndexOf(":")+1; >>> // if(lastIndex>0) >>> TreeNodeAdv node = new TreeNodeAdv(dir.Substring(lastIndex)); >>> e.Node.Nodes.Add(node); >>> } >>> } >>> >>>Please refer to it and let me know if this meets your requirements. >>> >>>Regards, >>>Guru Patwal >>>Syncfusion,Inc. >> >>TreeViewWithContextMenu_4970.zip >> >> > > > >

Administrator [Syncfusion]
Replied On June 17, 2004 08:42 AM UTC

Hi Satish As per my other forum posting, refer to the TreeViewAdvDemo sample (Tools\samples\Tree Package\TreeViewAdvDemo). This sample shows how you can use a context menu along with the TreeViewAdv control. Regards Arun

Satish
Replied On June 17, 2004 09:11 AM UTC

>Hi Satish > >As per my other forum posting, refer to the TreeViewAdvDemo sample (Tools\samples\Tree Package\TreeViewAdvDemo). This sample shows how you can use a context menu along with the TreeViewAdv control. > >Regards >Arun

Satish
Replied On June 17, 2004 09:12 AM UTC

Hi Arun, Thanks for your mail. I have already implemented this. thanks Satish > > >>Hi Satish >> >>As per my other forum posting, refer to the TreeViewAdvDemo sample (Tools\samples\Tree Package\TreeViewAdvDemo). This sample shows how you can use a context menu along with the TreeViewAdv control. >> >>Regards >>Arun

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

;