Flexible TreeView allows to customize summaries either in design-time or in run-time.
Design-time customization
To customize summaries in design-time, use the Summaries treeview property`s designer in Visual Studio.
Run-time customization
You can customize summaries in run-time using the summary`s context menu. To show it, right click on the summary or on the summary area`s empty space. To disallow showing the context menu in run-time, disable the Options.Summary.ShowContextMenu treeview property (enabled by default). The summary`s context menu allows you to change the summary`s settings or delete the summary.
Flexible TreeView supports summaries run-time customization by using the customization dialog, accessible from the summary context menu. To do that, select the 'Summary editor' menu item. To disallow showing the customization dialog, disable the Options.Summary.AllowCustomize treeview property (enabled by default).
Events
To customize summaries in run-time, Flexible TreeView provides these events:
SummaryCreated – raises when a new summary has been added either from the context menu or customization dialog. Use this event to dynamically initialize new summary;
FormatSummaryValue – raises when treeview need to display the summary value. There you can dynamically format any summary value.
Run-time summary auto-creation
Every summary is bound to a node control to get data to aggregate. To add new summary from the context menu or customization dialog in run-time, treeview should know to which node control to bind new summary. To inform treeview of these node controls, fill the Summaries.DefaultNodeControls treeview property with desired node controls for every column as shown below:
Example:
// every new summary, created in the ‘priceColumn’ column will be bound to the textboxNodeControl node control.
tree.Summaries.DefaultNodeControls.Add(priceColumn, textboxNodeControl);// every new summary, created in the treeview without columns will be bound to the numericNodeControl node control.
tree.Summaries.DefaultNodeControls.Add(null, numericNodeControl);
Note that you can adjust only one node control for every column or for NULL value (in the treeview without columns). User cannot add the summary if there is no defined node control for a target column. Treeview generates the SummaryCreated event for every newly created summary, where you can initialize it as shown below:
Flexible TreeView v2.6 has been released with Visual Studio 2010 support, new NodeDateTime node control, data access great speed increase and much more.