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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

treeView multiselect w/comboBox

Thread ID:

Created:

Updated:

Platform:

Replies:

71019 Jan 11,2008 06:50 PM UTC Feb 5,2008 06:16 AM UTC WinForms 4
loading
Tags: Tools
Bruce Gordon
Asked On January 11, 2008 06:50 PM UTC

I'd like the following-A drop down combo box whose dropdown is a treeView. The tree view will support a check box for each item. More than one can be checked. Can this be done? Is there a restriction if I'm on Syncfusion 4.4.0.51? thanks, -Bruc


Bruce Gordon
Replied On January 11, 2008 07:01 PM UTC

I forgot to add that I'd like the combo box to be read only. Ideally I could put my own "summary" into the combo box text area. For example if the tree view had Item1, item2, selected, then the combo box could show "item1, item2".

>I'd like the following-A drop down combo box whose dropdown is a treeView. The tree view will support a check box for each item. More than one can be checked. Can this be done? Is there a restriction if I'm on Syncfusion 4.4.0.51? thanks, -Bruc




J.Nagarajan [Syncfusion]
Replied On January 21, 2008 07:54 PM UTC

Hi Bruce ,

You can achieve this with version 4.4.0.51. Please refer to the following sample which has Combobox with TreeView as a dropdown, in which all the items of the treeview can be checked/unchecked.

To put your own summary like, to show all the all the checkeditems in the combobox area, please use the below code.

if (this.treeViewAdv1.CheckedNodes.Count > 0)
{
string val = "";
char delimiter = '','';
foreach (TreeNodeAdv node in this.treeViewAdv1.CheckedNodes)
{
if (val.Length > 0)
val += delimiter;
val += node.Text;
}
this.comboDropDown1.Text = val;
}

Here is a sample tested with version 4.4.0.51
http://websamples.syncfusion.com/samples/Tools.Windows/F71019/main.htm

Please let me know if you have any questions.

Regards,
Nagaraj


Andrew Skalkin
Replied On January 29, 2008 11:51 PM UTC

It'll be great if Syncfusion had such a control (the one that supports data binding, themes, etc) out-of-the-box. We have written a similar one (also, the drop-down area is resizable), but it lacks theme support.


SubhaSheela R [Syncfusion]
Replied On February 5, 2008 06:16 AM UTC

Hi Bruce,

Thank you for using Syncfusion products.

1. Resizing
You can resize the ComboDropDown by setting SizableToolWindow to the FormBorderStyle property of the PopupContainer's PopupHost.

this.comboDropDown3.PopupContainer.PopupHost.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
// Necessary to set the host's client size every time, especially since the popup's Dock style is set to DockStyle.Fill.
if (!(this.comboDropDown3.PopupContainer.PopupHost.Size.Width >= 140))
this.comboDropDown3.PopupContainer.PopupHost.Size = new System.Drawing.Size(140, 150);
// So that the popup container will Fill the entire popup host when resized.
this.comboDropDown3.PopupContainer.Dock = DockStyle.Fill;

2. Customizing the appearance
You can change the scrollbars color by setting true to Office2007ScrollBars and also setting its ColorScheme to blue using its Office2007ScrollBarsColorScheme property. By using ForeColor property, you can change forecolor of the node text.

this.treeViewAdvDataBound1.Office2007ScrollBars = true;
this.treeViewAdvDataBound1.Office2007ScrollBarsColorScheme = Office2007ColorScheme.Blue;
this.treeViewAdvDataBound1.ForeColor = Color.Red;

3. Data Binding
You can also bind data to the TreeViewAdv in ComboDropDown. Please refer the sample available in the link below. After downloading, you can refer with TreeViewAdvDataBound_Demo folder and please let me know if it helps:

http://websamples.syncfusion.com//samples/Tools.Windows/F71019/main.htm

Regards,
Subhasheela R



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

;