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

Treeview inside of a combobox inside of a radpanelbar

1 Answer 95 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Pepito
Top achievements
Rank 1
Pepito asked on 30 Apr 2008, 12:55 PM
 

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

1 Answer, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 30 Apr 2008, 01:20 PM
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
Tags
PanelBar
Asked by
Pepito
Top achievements
Rank 1
Answers by
Erjan Gavalji
Telerik team
Share this question
or