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

Linkbutton disapear after radtreeview node clicked

1 Answer 29 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Kev
Top achievements
Rank 1
Kev asked on 26 Jan 2016, 11:39 AM

Hello, 

I have a little problem with Radtreeview and a hide linkbutton. When i click on a node with the event "OnClientNodeClicked", the js execute a function that show the linkbutton, but after couple of second the linkbutton disapear or return to his start states (hide).

Have you a solution to this problem.

Thanks a lot

 

 My client code:

Aspx: 

<asp:LinkButton runat="server" ID="lkbAdd"  OnClientClick="OnClientClickAdd()"><img src="Images/Add-24.png" alt="Add" title="Add node"/></asp:LinkButton>

 

<telerik:RadTreeView ID="RadTreeView2" runat="server" Width="400px" Height="400px" OnNodeClick="RadTreeView2_NodeClick" OnNodeDataBound="RadTreeView2_NodeDataBound" BorderColor="Black" BorderWidth="1" OnClientNodeClicked="OnClientNodeClicked">
      <DataBindings>
               <telerik:RadTreeNodeBinding Expanded="True"></telerik:RadTreeNodeBinding>
      </DataBindings>
</telerik:RadTreeView>

 

JS:

 function OnClientNodeClicked(sender, eventArgs)
        {
            var listItem = document.getElementById('<%= lkbAdd.ClientID %>');

            var node = eventArgs.get_node();
            var nodeValue = node.get_value();
            node.select();

            if(nodeValue > 9990000000)
            {
                listItem.style.display = "inline-block";
            }
            else
            {
                listItem.style.display = "none";
            }

            args.set_cancel(true);

        }

 

My Server Code:

 protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
           //....

            lkbAdd.Style.Add("display", "none");
        }
    }

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 29 Jan 2016, 09:00 AM
Hello Kev,

Please try achieving this using the hide() method provided by jQuery and let me know about the result:
http://api.jquery.com/hide/

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
TreeView
Asked by
Kev
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or