Version

CreateBehavior<TBehavior> Method

Looks for the behavior of provided type in the collection. If found a reference to the behavior is returned, otherwise the behavior is created and added to the collection. This method will be able to locate the already created behavior only after the grid has loaded its view state. If this method is called before the control has a chance to process its view state the creation of the behavior should only be done on initial render, not on postbacks.
Syntax
'Declaration
 
Public Function CreateBehavior(Of TBehavior As {New, GridBehavior})() As TBehavior
public TBehavior CreateBehavior<TBehavior>()
where TBehavior: new(), GridBehavior

Type Parameters

TBehavior
Type of the behavior to create.

Return Value

Reference to an instance of requested behavior.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also