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

Radtreeview with Radcombobox

2 Answers 189 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
mayur
Top achievements
Rank 1
mayur asked on 16 Apr 2015, 01:41 AM

Hi,
I am working on radcombobox and radtreview with checkbox property, where when i am cheking nodes from radtreeview that checked item  text must be shown.but three requirment  that is
1.if parent node is checked all child node must be checked and there text must be shown on radcombobox
2.if any one of child is unchecked then parent node must be unchecked
3.if all child node is checked then automatically parent node must be checked.
without using tristate,and checkchild node property.becoz if i use tristate property then text of parent child is also shown in radcombobox even all child is not checked.

so i want help for 3rd option i.e if all child node is checked then parent node must be checked withoout using tristate property. in my example i have 2 parent each parent have two child so how to identify that this particular parent have some child. 

reason behind to disabled tristate property is if any one of child is checked  then it shows the text of that child aloong with that parent child which i dont want.

2 Answers, 1 is accepted

Sort by
0
mayur
Top achievements
Rank 1
answered on 16 Apr 2015, 02:50 AM

this is source view

     <telerik:RadComboBox ID="RadComboBox1" runat="server" EmptyMessage="select the bikes" Height="128px" Width="411px">
            <ItemTemplate>
        <telerik:RadTreeView ID="RadTreeView1" runat="server" CheckBoxes="true" OnClientNodeChecked="OnClientNodeChecked">
            <Nodes>
                <telerik:RadTreeNode runat="server" Text="bikes" >
                    <Nodes>
                        <telerik:RadTreeNode runat="server" Text="apache"></telerik:RadTreeNode>
                        <telerik:RadTreeNode runat="server" Text="pulsar"></telerik:RadTreeNode>
                    </Nodes>
                </telerik:RadTreeNode>
            </Nodes>
            <Nodes>
                <telerik:RadTreeNode runat="server" Text="cars" >
                    <Nodes>
                        <telerik:RadTreeNode runat="server" Text="mustang"></telerik:RadTreeNode>
                        <telerik:RadTreeNode runat="server" Text="audi"></telerik:RadTreeNode>
                    </Nodes>
                </telerik:RadTreeNode>
            </Nodes>
        </telerik:RadTreeView>
                </ItemTemplate>
               <Items>
        <telerik:RadComboBoxItem Text="" />
      </Items>
</telerik:RadComboBox>

 

​now when i use tristate property and if i checked any one child parent also checked and it shows the text of parent and child also which i dont want. i want only if all child checked then only parent is checked and shows its text.

0
Accepted
Magdalena
Telerik team
answered on 17 Apr 2015, 10:31 AM
Hello Mayur,

Thank you for contacting Telerik support.

We recommend you to use RadTreeView control for this purpose, instead of using RadComboBox with RadTreeView in an item template.

Accessing RadTreeView in the RadDropDownTree control in code behind can be achieved by RadDropDownTree1.EmbeddedTree. You can find more detailed information about it in our documentation article about Accessing the Embedded Tree in the DropDown.

Expanding and collapsing nodes can be achieved by the methods expand() and collapse(). We would like to refer you to our article about collapsing and expanding nodes in RadTreeView.

Do not hesitate to contact us if you have other questions.


Regards,
Magdalena
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
TreeView
Asked by
mayur
Top achievements
Rank 1
Answers by
mayur
Top achievements
Rank 1
Magdalena
Telerik team
Share this question
or