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

[Solved] RadDropDownTree in PopUp WebUserControl

4 Answers 139 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jeffrey
Top achievements
Rank 1
Jeffrey asked on 30 Jun 2014, 08:36 PM
I have created a RadDropDownTree inside a Popup WebUserControl for editing a row in the grid.
In the grid's UpdateCommand event, I grab a handle to the RadDropDownTree like this:

RadDropDownTree ddtMount = userControl.FindControl("ddtMount") as RadDropDownTree;

Even if the user check-marks some of the items in the tree, they all come back as "checked = false".

Anyone have an idea what I could be doing wrong? I can post more code details if needed.

TIA,

Jeffrey Taylor

4 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 01 Jul 2014, 05:57 AM
Hi Jeffrey,

Please try the below c# code snippet to achieve your scenario.

C#:
protected void rgrdOrders_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
    //accessing the user control page
    UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
    //accessing  RadDropDowntree inside UserControl page
    RadDropDownTree dropDownTree = userControl.FindControl("ddtMount") as RadDropDownTree;
    //get the count of the checked nodes
    int checkedItemsCount = dropDownTree.EmbeddedTree.CheckedNodes.Count;
}

Thanks,
Princy.
0
Jeffrey
Top achievements
Rank 1
answered on 01 Jul 2014, 02:15 PM
I compared your source to mine. They are exactly the same. You just added the "checkedItemsCount". The checkedItemsCount comes back zero - even though I checked some of the items.

I can post more source if you think it would be helpful, but I will need to pare it down to stop using a database behind the grid and other controls.

Thanks for the ideas. Do you have any other suggestions?
0
Jeffrey
Top achievements
Rank 1
answered on 01 Jul 2014, 03:01 PM
I have created a small example project and am going to open a support ticket with Telerik.
I will post the answer when I get it.
0
Jeffrey
Top achievements
Rank 1
answered on 01 Jul 2014, 10:21 PM
I figured out that I had an unneeded DATABIND command in the page_load for the user control.
This one is now resolved. Thanks for the help Princy.
Tags
Grid
Asked by
Jeffrey
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jeffrey
Top achievements
Rank 1
Share this question
or