• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 967
  • Last Modified:

asp.net c# TreeView1_TreeNodeCheckChanged not firing

I am trying to run some code when a node is checked (specifically recursively checking child nodes)

BUt when I run the code nothign happens..I am using teh TreeView1_TreeNodeCheckChanged event handler and it is wired into the control..but it never runs the code...debugging stops dont ever get fired.

DOes this event only run on postback or something?

Should I be using a diferent event handler?
0
Prysson
Asked:
Prysson
  • 3
  • 3
1 Solution
 
Edwin_CCommented:
You are correct.  You can catch this event only after postback.  You may try using the SelectedNodeChanged event.  It is fired when user clicks on the node.
0
 
PryssonAuthor Commented:
Does checking a node cause the SelectedNodeChanged event to fire?
0
 
PryssonAuthor Commented:
Never mind it doesnt..this wont work for me. I have to have the check boxes recursivley check and uncheck when other boxes are checked.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Edwin_CCommented:
Do you mean you can allow users to check one item only?  If so, treeview seems to be not suitable for you.  Can you use radiobuttonlist?
0
 
PryssonAuthor Commented:
no its not a single selection. I need child nodes to be checked when the parent node is checked and parent node to uncheck when a child node is unchecked. I have the code to do this but the only event handler that deals with the check boxes is the checkchanged EH...seems kind of retarded to me that the treeview doesnt have a means of firing and event when someone checks a check box.
0
 
Edwin_CCommented:
I think this can be done at client side with javascript.  I found this in the internet http://forums.asp.net/3/1238700/ShowThread.aspx

I have used the treeview from telerik which has this function using simple javascript.  See http://www.telerik.com/community/forums/thread/b311D-cekgk.aspx

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now