TreeView Question - 01-06-2005 , 03:19 AM
I am deriving my own TreeView control from the 1.0 Framework TreeView.
I have overriden the OnAfterSelect method and want to respond to selection
of a node.
The issue I am having is that if the user selects a node and then clicks the
node again, no OnAfterSelect event is triggered. I figure this is the way
it is supposed to work but would like to work around this.
Has anybody had this issue and found a way to work around it?
I thought I could monitor OnMouseUp events and see if the left mouse button
is clicked on the selected node and then call OnAfterSelect from with in
This creates a new issue of when you actually do select another node, now
OnAfterSelect gets called twice (once for the select and once for the mouse
up event). Oh and in case your wondering, I'm pretty sure the OnAfterSelect
event is fired before the OnMouseUp event. A snipet of my code is shown
protected override void OnAfterSelect(TreeViewEventArgs tvea)
do really cool stuff when node is selected!
protected override void OnMouseUp(MouseEventArgs mea)
if (mea.Button == MouseButtons.Left)
TreeNode node = GetNodeAt(mea.X, mea.Y);
if (node == this.SelectedNode)
Re: TreeView Question - 01-06-2005 , 09:37 AM
Telerik have put a lot of work into a custom treeview - have a look
"Beringer" <borden_eric (AT) invalid (DOT) com> wrote
|Thread Tools||Search this Thread|