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

How to Display a Button when Expand the RadTreeView ?

1 Answer 65 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
D.SRINIVASA
Top achievements
Rank 2
D.SRINIVASA asked on 18 Jul 2011, 01:44 PM
Hi,

I am D.Srinivasa

in my project i have a  RadTreeView  to display a data from DataBase. when i expand a Radtree view parent node then it checks the condition successfully. if the condition satisfies then i want to display a button in my  page. but in my logic it check the condition successfully but it doesn't display the Button in the Page. Button default state is Visible =False.

The following is the code for RadNodeExpand()

Protected Sub RadTreeView1_NodeExpand(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles RadTreeView1.NodeExpand
PopulateNodeOnDemands(e, TreeNodeExpandMode.ServerSideCallBack)
    End Sub



Protected Function PopulateNodeOnDemands(ByVal e As RadTreeNodeEventArgs, ByVal expandMode As TreeNodeExpandMode) As TreeNodeExpandMode
Dim data As DataTable = GetChildNode(e.Node.Value)
Dim message As String = ""
For Each row As DataRow In data.Rows
Dim node As New RadTreeNode()
node.Text = row("child_code").ToString()
node.Value = row("child_id").ToString()
'node.ExpandMode = expandMode
If row("job_status").ToString() = "NS" Then
Button.Visible=True
node.BackColor = Color.LightSkyBlue
message = message.ToString() + node.Text
MsgBox(message.ToString())
End If
e.Node.Nodes.Add(node)
Next
e.Node.Expanded = True
End Function

Please Help How can i display the Button Dynamically..

Thank You
D.Srinivas

1 Answer, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 20 Jul 2011, 04:03 PM
Hi D.Srinivasa,

Perhaps you are expanding the TreeVIew in an ajax request?
If this is the case and the Button is still not visible, then most likely to me is that the button is not updated in this same request. This means that if you use panels (RadAjaxPanel or UpdatePanel) the TreeView and the button are not in the same panel, or if you use RadAjaxManager, the TreeView (as control triggering update), does not include the button as an UpdatedControl.

Could you, please, share a full page reproducing this behavior?


Regards,
Nikolay Tsenkov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
ComboBox
Asked by
D.SRINIVASA
Top achievements
Rank 2
Answers by
Nikolay Tsenkov
Telerik team
Share this question
or