This is a migrated thread and some comments may be shown as answers.

ComboBox and TreeView Issue

3 Answers 58 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Udi
Top achievements
Rank 1
Udi asked on 09 Dec 2010, 04:47 PM
Hello,

I have two Questions:

1. I have a TreeView in Combobox.
    Each node in the treeview contain checkbox.
    The treeview has footer that has a button named "OK".
    I would like to check some nodes and only when i click on the "OK" button,
    all the node's text that i have checked will show on the input field of the combo box with the ";" seperator.

    I succeeded to get the combobox instance from the javascript function when i click on the "OK" button, but
    i don't know how to get the treeview instance or the nodes that have checked, before the clicking.

    Here is the js function:

    
function approveClick(comboBox)
{
  //Here i would like to get the checked nodes,
  //from the treeview and then to concatenate the nodes text value,
  //to the input field like:
  
    comboBox.set_text("node1;node2;node3");
  
    comboBox.hideDropDown();
}

    Any suggestions?

2. How can i paint the combobox's dropdown area background (By default its white).

Thanks,

Oren

3 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 09 Dec 2010, 07:32 PM
Hello Oren,

This is how you would retrieve the TreeView for the RadComboBox:

var tree = combo.get_items().getItem(0).findControl("[RadTreeViewID]");

After that, just loop through the get_selectedNodes collection of the RadTreeView.

Client-side RadTreeView reference: http://www.telerik.com/help/aspnet-ajax/tree_clientradtreeviewobject.html

To answer your second question. Since your using the RadTreeView, just set the BackColor of the RadTreeView control, since it takes up all the space of the drop-down.

I hope that helps.
0
Udi
Top achievements
Rank 1
answered on 12 Dec 2010, 12:31 PM
Thanks Cori for your replay,

Your first answer was excellence.

I have a problem with the second answer,
If i set the background of the tree view (RadTreeView1.BackColor = Color.GreenYellow),
not all the area gets paint with red. (see attached).

Do you have another solution.
I need to paint all the dropdown area.

Thank you,
Oren
0
Udi
Top achievements
Rank 1
answered on 12 Dec 2010, 12:32 PM
Thanks Cori for your replay,

Your first answer was excellence.

I have a problem with the second answer,
If i set the background of the tree view (RadTreeView1.BackColor = Color.GreenYellow),
not all the area gets paint with red. (see attached).

Do you have another solution.
I need to paint all the dropdown area.

Thank you,
Oren
Tags
ComboBox
Asked by
Udi
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Udi
Top achievements
Rank 1
Share this question
or