Flexible TreeView Flexible TreeView


Support & Community

Events

Previous Table of Contents Next

Flexible TreeView contains many events to notify you of any change inside the treeview or any of its parts.


Own events tab

For easy access to treeview events in design–time, Flexible TreeView has a separate tab with its own events list near the standard events tab.

Separate Visual Studio events tab


Two–step actions

Flexible TreeView allows you to flexibly control the treeview`s behavior by using two–step actions. For each action, there will be two events raised, before and after execution of the action. To identify the current step in the event handler, use the IsBeforeAction property of the passed event argument. IsBeforeAction is enabled (first step) if this event is raised before executing an action and disabled (second step) if the event is raised after an action.
On the first step, you can cancel execution of that action by enabling the Cancel event parameter`s property.


Every action will generate two events, but if you need just to execute a code and don’t need those two–steps, do it when the IsBeforeAction property is disabled (second step).

 

Replace treeview`s default behavior

Flexible TreeView allows you to override default behavior for almost all actions like selected node changes, etc. To do that, you need to handle the appropriate event that is raised to notify you of those changes, set the Cancel property to the True value, and execute your own code.
Cancelation is supported for both single and two–step actions. For two–step actions, execute your code only when the IsBeforeAction property is enabled (second step).

Example:

// Replace the two–step action`s default behavior.
void tree_MouseDown(FlexibleTreeView pTreeview, MouseActionArgs pArgs)
{
  // replace the mouse down event logic.
  if (pArgs.IsBeforeAction && pArgs.Node.Text == "Some node")
  {
    // execute your custom code here…
 
    // skip the default behavior. Note that the second event wouldn`t be raised.
    pArgs.Handled = true;
  }
}
 
// Replace the one–step action`s default behavior
void tree_SelectionChanging(FlexibleTreeView pTreeview, SelectionChangingEventArgs pArgs)
{
  // replace the node selection logic
  if (pArgs.Node.Text == "Some node")
  {
    // execute your custom code here…
 
    // skip the default behavior
    pArgs.Cancel = true;
  }
}

Previous Top Next


Last news
Bookmark and Share
Use Flexible TreeView in WPF project
Sunday, 18 December 2011

Do you have a WPF project and want to use Flexible TreeView there? No problem!

Flexible TreeView v3.4
Friday, 16 December 2011

Flexible TreeView v3.4 maintenance release has been released.

Flexible TreeView v3.3
Friday, 23 September 2011

Flexible TreeView v3.3 maintenance release has been released. Separate assemblies for .NET 2.0, 4.0 and 4.0 Client Profile, HTML markup extension, etc.

Latest release

Version:
Release date:
3.4
Dec 16, 2011


Copyright © 2006-2012 ARMSoft. All rights reserved.