Treeview inside of a combobox inside of a radpanelbar

2 posts, 0 answers
  1. Pepito
    Pepito avatar
    17 posts
    Member since:
    Feb 2008

    Posted 30 Apr 2008 Link to this post

     

    Hi Telerik:

     I am gonna simplify the problem.

    Basically, there is a combobox inside of a  treeview like the  demo example.

    The problem is the the combobox is inside of a radpanelbar. nad when i try to get
    the object (the treeview by code, i get null)

    so i try to get the instance in the following way:

    TelerikQ1.

    RadTreeView rtvgroupscombobox = (RadTreeView)

    _rpbproductgroups_.FindItemByValue(

    "_rpiproductgroups_").FindControl("_ctlparent_").FindControl("_rtvgroupscombobox_");

    where :

    rpbproductgroups is a Radpanelbar

    rpiproductgroups is a Radpanelitem

    _ctlparent_ is a combobox

    _rtvgroupscombobox_ is a treeview

    rtvgroupscombobox  is the object where i keep the treeview


    or this other way : 


    TelerikQ1.

    RadTreeView _rtvgroupscombobox_ = (RadTreeView)

    _rpbproductgroups_.FindItemByValue(

    "_rpiproductgroups_").

    FindControl(

    "_rtvgroupscombobox_");

    where : 

    rpbproductgroups is a Radpanelbar

    rpiproductgroups is a Radpanelitem

    _rtvgroupscombobox_ is a treeview

    rtvgroupscombobox  is the object where i keep the treeview



    But it is always null.

    How can i get it.

    Regards.Pepito

  2. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 30 Apr 2008 Link to this post

    Hi Pepito,

    The RadComboBoxItem is an INamingContainer therefore the exact control cannot be found. You can try the following:

    RadPanelItem panelItem = _rpbproductgroups_.FindItemByValue("_rpiproductgroups_");
    RadComboBox comboBox = (RadComboBox)panelItem.FindControl("_ctlparent_");
    RadComboBoxItem comboBoxItem = comboBox.FindItemByValue("THE_ITEM_VALUE");
    RadTreeView treeView = (RadTreeView)comboBoxItem.FindControl("_rtvgroupscombobox_");

    Cheers,
    Erjan Gavalji
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top