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

Controls disappear when i wont read it

1 Answer 54 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Michał
Top achievements
Rank 1
Michał asked on 01 Aug 2008, 08:01 PM
Hello.
I have a wery big problem with Telerik.TreeView.

I put the my Control to the tree view :

Telerik.Web.UI.RadTreeNode tnFormat = new Telerik.Web.UI.RadTreeNode("Format");
                        Future.Controls.tvDropDownNode ddNode1 = (Future.Controls.tvDropDownNode)LoadControl("..\\Controls\\Raporty\\tvDropDownNode.ascx");
                        ddNode1.ID = "Format";
                        ddNode1.Label1.Text = "Format";
                        ddNode1.DropDownList1.Items.Add("Standardowe");
                        ddNode1.DropDownList1.Items.Add("Liczbowe");
                       
                        tnFormat.Controls.Add(ddNode1);

                        rTv2.Nodes[indexGL].Nodes[0].Nodes.Add(tnFormat);

The control is show on the tree.

Wen I won`t read data from the my control te Control is disappear.

I red data like this :

Future.Controls.tvDropDownNode tn = (Future.Controls.tvDropDownNode)rTv2.Nodes[ii].Nodes[0].Nodes[0].Controls[0];

Please Help Me. Best Regards


1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 04 Aug 2008, 07:53 AM
Hi MichaƂ,

Controls added dynamically to a tree node need to be recreated after postback. Otherwise they will disappear as RadTreeView cannot recreate custom controls after postback. The same behavior is present with the built-in Panel and Placeholder controls.

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Michał
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or