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

Textboxex in a RadTreeView

7 Answers 95 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Philip Saltskog
Top achievements
Rank 2
Philip Saltskog asked on 05 Nov 2008, 10:17 AM
I'm using version 2008.2.820.35 and I've successfully add textboxex to each node and also a literal text there too, but I can't get it out there with findcontrol??

Dim nodeCollection As System.Collections.Generic.IList(Of RadTreeNode) = R1.CheckedNodes  
Dim node As RadTreeNode  
For Each node In nodeCollection  
    Dim testCount As Integer = node.Controls.Count  
    Dim boxBanner As TextBox = node.FindControl("boxBannerID" & node.Value)  
next node 

Any ideas why I don't get it from the node in the IList?

/Thanks

7 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 06 Nov 2008, 08:51 AM
Hi Philip Saltskog,

It is difficult to say why this is happening only by looking at this code.

Could you provide more information such as how the TextBoxes are added to Nodes? How are their IDs generated?

Thank you in advance.

Sincerely yours,
Simon
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Philip Saltskog
Top achievements
Rank 2
answered on 06 Nov 2008, 10:57 AM
When I'm create the box I use this code.


 

Dim myBox As New TextBox   
myBox.ID = "boxBannerID" & dbRow("ID")   
node.Controls.Add(myBox)  

dbRow is a datarow in a datalist from DB.

.aspx page
<input name="R1$i0$i0$boxBannerID79" type="text" value="3" id="R1_i0_i0_boxBannerID79" class="brodtext" style="width:20px;" />

 

0
Simon
Telerik team
answered on 06 Nov 2008, 11:06 AM
Hello Philip Saltskog,

Thank you for the additional information.

Controls added to Nodes in this way should be added on each postback, and not only on the first page load. Could you please make sure that this is realized in your case?

You can avoid this issue, however, by using dynamic runtime Templates as shown in this help article.

Greetings,
Simon
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Philip Saltskog
Top achievements
Rank 2
answered on 07 Nov 2008, 09:00 AM
I'm now using the template class, but I'm still not get anything with findcontrol?
Dim boxBanner As TextBox = node.FindControl("boxBannerID" & node.Value) 

For each node i call
template.InstantiateIn(node) 
but when I'm use postback it's empty. Even if I call my sub from a postback it's empty of controls. I only get the node control here.

Any ideas?

/Thanks
0
Philip Saltskog
Top achievements
Rank 2
answered on 07 Nov 2008, 10:32 AM
I solved it with request.form :)
Dim boxBanner As String = Request.Form(node.UniqueID & "$boxBannerID" & node.Value) 
When the postback come the textbox is disappeared, but I think you have a solution on this soon :)!?? Might allready have any solution?

That important thing is I get the datavalue from the textbox :)

/Thanks
0
Philip Saltskog
Top achievements
Rank 2
answered on 07 Nov 2008, 03:02 PM
Found another strange behavior.

When I add controls to the node I get wrong node.value on the checked nodes. If I checked two nodes and use
Dim nodeCollection As System.Collections.Generic.IList(Of RadTreeNode) = R1.CheckedNodes 
I get wrong node on the child node.

I think this is instable and I will wait till Telerik release som support for controls in a node...

Telerik: Do you know when you will support that?

/Thanks
0
Simon
Telerik team
answered on 07 Nov 2008, 03:25 PM
Hi Philip Saltskog,

Controls are supported by RadTreeView and the best approach is to use Templates.

Regarding your case, without additional information I will be unable to determine why Templates do not work as expected at your side.

Could you please open a formal support ticket and send us the problematic pages (or project) there (including the second issue you are experiencing)?

We will inspect the files and hopefully will provide solutions or temporary workarounds.

Thank you in advance for your co-operation.

Sincerely yours,
Simon
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Philip Saltskog
Top achievements
Rank 2
Answers by
Simon
Telerik team
Philip Saltskog
Top achievements
Rank 2
Share this question
or