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

Is there a property to know whether all the nodes are checked

1 Answer 74 Views
DropDownTree
This is a migrated thread and some comments may be shown as answers.
Tao
Top achievements
Rank 1
Tao asked on 29 Jan 2014, 12:25 AM
something like radDropDownTree.AllNodesChecked == true.

Thanks!

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 29 Jan 2014, 04:22 AM
Hi Tao,

As a work around please have a look into the following code snippet to check whether all nodes are checked or not.

ASPX:
<telerik:RadDropDownTree ID="RadDropDowntree1" runat="server" CheckBoxes="SingleCheck"
    DataSourceID="SqlDataSource1" DataFieldID="id" DataFieldParentID="parentid" DataTextField="text">
    <ButtonSettings ShowCheckAll="true" />
</telerik:RadDropDownTree>
<telerik:RadButton ID="RadButton1" runat="server" Text="AllChecked" OnClick="RadButton1_Click">
</telerik:RadButton>

C#:
protected void RadButton1_Click(object sender, EventArgs e)
{
    int flag = 0;
    foreach (RadTreeNode node in RadDropDowntree1.EmbeddedTree.GetAllNodes())
    {
        if (node.Checked == false)
        {
            flag = 1;
            break;
        }
    }
    if (flag == 0)
        Response.Write("all Check"); // all nodes are checked
    else
        Response.Write("Uncheck"); // unchecked nodes are there
}

Thanks,
Shinu.
Tags
DropDownTree
Asked by
Tao
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or