ComboBox and TreeView Issue

4 posts, 0 answers
  1. Udi
    Udi avatar
    36 posts
    Member since:
    Sep 2010

    Posted 09 Dec 2010 Link to this post

    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
  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 09 Dec 2010 Link to this post

    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.
  3. Udi
    Udi avatar
    36 posts
    Member since:
    Sep 2010

    Posted 12 Dec 2010 Link to this post

    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
  4. Udi
    Udi avatar
    36 posts
    Member since:
    Sep 2010

    Posted 12 Dec 2010 Link to this post

    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
Back to Top