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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Subclass TreeViewAdv

Thread ID:

Created:

Updated:

Platform:

Replies:

88734 Aug 10,2009 01:34 PM UTC Aug 12,2009 02:02 PM UTC WinForms 1
loading
Tags: Tools
Ole-Johan Ellingsen
Asked On August 10, 2009 01:34 PM UTC

Hi.

I would like to create a subclass control, using TreeViewAdv as parent. I try "Add->User Control->Inherited User Control" and select the "Essential Studio\7.1.0.30\Assemblies\3.5\Syncfusion.Tools.Windows.dll" file. I get a list of controls, but TreeViewAdv is not one of them. Any ideas?

Balavasanth [Syncfusion]
Replied On August 12, 2009 02:02 PM UTC


Hi Ole-Johan,

Thanks for your interests in Syncfusion products.

First I will try explaining you the basic difference between the User Control and the InheritedUserControls. Though the Inherited Controls and User Controls conceptually both can be grouped under Custom Controls category, but there is a difference between Inherited User Controls and User Controls in a practical implementation

Inherited User controls are those existing controls that you would inherit to add custom functionalities. E.g. Wizard, MonthCalendarAdv which typically inherits the System.Windows.Forms.UserControl(in the source) but you could see the implementation of this control as something like

public class CustomizationPanel : System.Windows.Forms.UserControl
{
..
..

}

the control which has the parent as System.Windows.Forms.UserControl are populated when you add the Tools.Windows assembly in the Inherited user control dialog. That is the reason the TreeView is not shown as it is not inherited from a user control. Usually these are used for common validations, GUI features etc.

Solution for your requirement:

If your requirement is to extent our controls with some common application logic. Make the modifiers public, protected, add some revalidations. You can make use of a UserControl or a custom class and inherit our control. I will explain a small scenario where I tried to extend the TreeViewAdv in the TreeViewAdvExt(a new control), use that object as a new control and try populating it. Kindly make use of the code snippet for more idea.

//Extended a new control keeping the TreeViewAdv as base.

public partial class TreeViewAdvExt : TreeViewAdv
{
public TreeViewAdvExt()
{
InitializeComponent();
}


//implemented a new method to override the Vertical scrolling.

public void SetVScroll(bool value)
{
base.VScroll = value;
}
}


In my application.

//Created an instance of the new control.
treeviewadv1 = new TreeViewAdvExt();

//set its vertical scrolling to False.

treeviewadv1.SetVScroll(false);

Please find the below sample which explains the above.

http://files.syncfusion.com/support/Tools.Windows/7.1.0.30/Forum-88734/main.htm

We hope we are clear enough to your question. Please let us know still if you have any queries.

Regards,
Bala.




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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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

;