How to Display a Button when Expand the RadTreeView ?

2 posts, 0 answers
  1. D.SRINIVASA
    D.SRINIVASA avatar
    34 posts
    Member since:
    Oct 2010

    Posted 18 Jul 2011 Link to this post

    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
  2. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 20 Jul 2011 Link to this post

    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!

Back to Top