ActiveReports 19 .NET Edition
MESCIUS.ActiveReports.Viewer.Win Assembly / GrapeCity.ActiveReports.Viewer.Win Namespace / Viewer Class / TableOfContentsAfterSelect Event
Example

TableOfContentsAfterSelect Event
Occurs after an item is selected in the table of contents treeview.
Syntax
'Declaration
 
Public Event TableOfContentsAfterSelect As TreeViewEventHandler
 
Event Data

The event handler receives an argument of type TreeViewEventArgs containing data related to this event. The following TreeViewEventArgs properties provide information specific to this event.

PropertyDescription
Gets the type of action that raised the event.  
Gets the tree node that has been checked, expanded, collapsed, or selected.  
Remarks
The System.Windows.Forms.TreeViewEventArgs provides information about the selected item, enabling event handlers to access the item's properties and take appropriate actions, such as navigating to the corresponding section in the document.
Example
// Assuming 'viewer' is an instance of the Viewer class
// Subscribe to the TableOfContentsAfterSelect event
viewer.TableOfContentsAfterSelect += Viewer_TableOfContentsAfterSelect;
// Event handler for TableOfContentsAfterSelect
private void Viewer_TableOfContentsAfterSelect(object sender, TreeViewEventArgs e)
{
	var selectedNodeText = e.Node.Text;
	MessageBox.Show($"You have selected: {selectedNodeText}", "TOC Selection");
}
See Also