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

Check node without OnNodeClick firing?

5 Answers 137 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 12 Jan 2011, 08:56 PM
Hello,

I have a TreeView where clicking on a node should trigger a PostBack, but checking a CheckBox on a node should not trigger a PostBack.  Is this possible?  Currently checking the node fires the OnNodeClick event.

I believe it was working as I wanted prior to upgrading to version 2010.2.826.35.

<rad:RadTreeView ID="tree" OnNodeClick="NodeClick" AutoPostBack="true">

Thanks,
Jason

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 13 Jan 2011, 10:23 AM
Hello Jason,


Set the "AutoPostBackOnCheck"  property of TreeView to "false" to get desired output.

aspx:
<radT:RadTreeView ID="RadTreeView1" CheckBoxes="true" AutoPostBack="true" runat="server"  AutoPostBackOnCheck="false"
    MultipleSelect="True" OnNodeClick="RadTreeView1_NodeClick">
[Assuming that you are using RadControls for ASP.NET version (not Ajax)]



Thanks,
Princy.
0
Jason
Top achievements
Rank 1
answered on 13 Jan 2011, 03:47 PM
Thanks, but I'm using the ASP.NET AJAX version.
0
Jason
Top achievements
Rank 1
answered on 13 Jan 2011, 08:22 PM
I found it.  The "AutoPostBack" is a custom property that sets the PostBack property for each node.
0
Neha
Top achievements
Rank 1
answered on 25 Apr 2011, 10:07 PM
The "AutoPostBack" is a custom property that sets the PostBack property for each node. What does that mean? It's not working for me. How to say AutoPostBack="false" for ASP.NET AJAX
0
Jason
Top achievements
Rank 1
answered on 26 Apr 2011, 03:05 PM

I have a class that inherits from RadTreeView and I added the AutoPostBack property.  I made that property loop through all of the nodes of the tree and set the PostBack property to whatever value is passed in.

public class TV : RadTreeView
{
    private bool autoPostBack = false;
  
    public bool AutoPostBack
    {
        get
        {
            return autoPostBack;
        }
        set
        {
            autoPostBack = value;
  
            foreach (RadTreeNode tn in GetAllNodes())
            {
                tn.PostBack = autoPostBack;
            }
        }
    }
}
Tags
TreeView
Asked by
Jason
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jason
Top achievements
Rank 1
Neha
Top achievements
Rank 1
Share this question
or