Both the Chart and Diagram ThinWeb controls are build using MVC design pattern and share a set of common tools. Each tool generates a client side JScript object that captures tool specific client mouse events and optionally produces an update request to the server. The following sections describe the tools common to both the Chart and Diagram ThinWeb controls in the package.
Each tool has Enabled property that controls whether the tool is currently active and will process client events. By default this property is set to true meaning that the tool will process events, however you may choose to add disabled tools that the user can later enable by clicking on a button in the integrated toolbar that enables this tool. The following code snippet shows how to add two tools to the collection which are initially disabled:
C# |
Copy Code
|
---|---|
protected void Page_Load(object sender, EventArgs e) // add tooltip tool // give the user the ability to enable the tooltip / cursor change over bars |
Visual Basic |
Copy Code
|
---|---|
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If (Not NThinChartControl1.Initialized) Then ' perform initial initialization here bar.Values.Add(10) chart.Series.Add(bar) ' add tooltip tool ' add cursor tool ' give the user the ability to enable the tooltip / cursors change over bars |
The other common tool property is Exclusive, which is used to mark that when the tool is enabled it should be the only currently active tool. When the user clicks on a toolbar button that enables an exclusive tool all other tool that are marked as exclusive will be disabled. In the context of the code example above if you mark the tooltip and and cursor tools as exclusive:
C# |
Copy Code
|
---|---|
tooltipTool.Exclusive = true; |
Visual Basic |
Copy Code
|
---|---|
tooltipTool.Exclusive = True cursorTool.Exclusive = True |
The user will still be able to enable the tooltip or cursor tool from the toolbar, but never both of them simulataneously. The following topics discuss the common ThinWeb tools.