Showing posts with label RadTreeView. Show all posts
Showing posts with label RadTreeView. Show all posts

RadTreeView - The FindByTextCommand

RadTreeView provides a command called FindByTextCommand. The command looks for nodes which have the same Text property as the specified command parameter.

Here is an example of how to use the FindByTextCommand:

[C#] Using the FindByTextCommand
Telerik.WinControls.Commands.FindByTextCommand cmd = new FindByTextCommand();
List<object> result = RadTreeView.ExecuteBatchCommand(this.radTreeView1.Nodes, -1, cmd, "MyNode");
if(result != null)
{
// Found nodes.
}

[VB] Using the FindByTextCommand
Dim cmd As Telerik.WinControls.Commands.FindByTextCommand = New Telerik.WinControls.Commands.FindByTextCommand
Dim result As List(Of Object) = RadTreeView.ExecuteBatchCommand(Me.RadTreeView1.Nodes, -1, cmd, "MyNode")
If Not result Is Nothing Then
'Found nodes.
End If

? Dev Components ? RadControls for WinForms ? Telerik Windows Forms RadTreeView

Source of Information :  2002-2010 Telerik. All Rights Reserved. Help

RadTreeView Commands Overview

RadTreeView implements the Command pattern which allows adding functionality, which operates on RadTreeNodes, without needing to modify the code of RadTreeView. This makes it easy for developers to create their own commands should they find that the commands, which RadTreeView provides, are insufficient.

RadTreeView exposes two methods with two overloads each, which accept commands to execute. The methods are called ExecuteScalarCommand() and ExecuteBatchCommand(). The difference between those two methods is that ExecuteScalarCommand() works on a single RadTreeNode whereas ExecuteBatchCommand() works on many nodes. For example, if a command which searches for a node with specific text, is passed to ExecuteScalarCommand() only one node will be found and returned. Passing it to ExecuteBatchCommand will find all nodes that have this text and return all of them. The methods return object and List<Object> (List (Of Object) in VB) which means that commands are not required to return RadTreeNodes. For example you can search for nodes and when they are found, custom objects may be created and returned. This capability will be discussed in the Implementing Custom Commands topic.

Here is an abstract example of how commands are used with RadTreeView.

[C#]
Command cmd = new Command();
List<object> result = RadTreeView.ExecuteBatchCommand(nodeCollection, -1, cmd, commandParam1, commandParam2);
if(result != null)
{
// Found nodes.
}

[VB]
Dim cmd As Command = New Command
Dim result As List(Of Object) = RadTreeView.ExecuteBatchCommand(nodeCollection, -1, cmd, commandParam1, commandParam2)
If Not result Is Nothing Then
'Found nodes.
End If

The example above creates a Command object and passes it to the ExecuteBatchCommand() method of RadTreeView. The method accepts a node collection on which the command will be executed, the nesting level of the nodes which will be affected, the command object and parameters which the particular command accepts. The level in this case is -1 which indicates that the whole node hierarchy will be affected by the command.

The ExecuteScalarCommand() method is used in the exact same way with the difference that it affects only one node, and only one node is returned.

? Dev Components ? RadControls for WinForms ? Telerik Windows Forms RadTreeView

Source of Information :  2002-2010 Telerik. All Rights Reserved. Help

Telerik RadTreeView Key Features

Telerik RadTreeView is the supercharged tree view component for Windows Forms. It facilitates display, management, and navigation of hierarchical data structures. The product offers many advanced features like drag-and-drop, load on demand, context menus and data binding. RadTreeView features an extremely rich API, allowing you to achieve complex behavior in your applications. The skinning support nicely blends RadTreeView into the interface of your application.


Drag & drop
RadTreeView supports drag and drop within the same tree and between RadTreeView controls. The position indication cursor provides feedback to the user so that nodes can be dropped above, below or within a given node. When dragging to a hidden or collapsed node the control will scroll up/down and automatically open the collapsed node. Drag and drop behavior is customizable at the treeview and node levels, allowing you to restrict interactions between source and target nodes.


Rich styling capabilities
RadTreeView uses the innovative theming mechanism that the Telerik Presentation Framework (TPF) provides. You can build your own themes interactively using the Theme Builder or select one of the ready-to-use skins, including Office 2007 and Windows Vista.


Load on demand
For industrial strength applications with heavy data requirements, the Load On Demand feature reduces loading time and performance overhead.


Rich data binding support
RadTreeView binds to hierarchical data for most popular databases, custom business objects and XML. RadTreeView binds to any object that supports IList, IListSource or IBindingList. RadTreeView can also load and save XML directly to file or string.


Context menus
Expand RadTreeView functionality by adding context menus either for the entire treeview or to each node. You have the capability to attach a different context menu to each tree node. Each context menu can be individually styled.


Incremental Search
RadTreeView supports incremental search, i.e locating nodes as you type the initial characters of the node's text. This enables users to locate desired nodes quickly when the treeview has a large number of nodes.


Multiple selection
RadTreeView allows multiple items to be selected using the Shift and Ctrl keys. Multiple selections can be dragged and dropped and can also be iterated programmatically.


Tri state check boxes
Check boxes can have a third "indeterminate" state to provide feedback to the user. For example the screenshot below shows "Node1" in an indeterminate state to show the user that not all child nodes are checked.


Mixed Check Boxes and Radio Buttons


Custom node drawing
The DrawNode event allows a completely custom graphic representation of each node. A graphics object passed to the event handler provides a rich set of methods and properties.


RTL Support
RadTreeView supports right-to-left layout and can be used in multilingual applications.


Rich design time environment
The RadTreeView Property Builder provides a quick, intuitive way to work with treeview and nodes. A preview window displays instant feedback and an Expert Mode allows maximum control.

? Dev Components ? RadControls for WinForms ? Telerik Windows Forms RadTreeView

Source of Information :  2002-2010 Telerik. All Rights Reserved. Help
 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Information Computer and Technology - All Rights Reserved
Template Modify by Creating Website
Proudly powered by Blogger