<ig:WebDataGrid ID="wdg1" runat="server"> <Behaviors> <ig:Clipboard /> </Behaviors> </ig:WebDataGrid>
This topic explains how to configure Clipboard support for the WebDataGrid™ and WebHierarchicalDataGrid™controls.
This topic contains the following sections:
You need to first read the following topics:
Using the standard keyboard shortcuts of CTRL+C to copy, CTRL+V to paste, and CTRL+X to cut users can manipulate the grid’s data in the clipboard.
The Clipboard behavior is added to the grid like the other grid behaviors through markup, code, or the designer. The Selection and Activation behaviors are required to select cells for copying. The Editing core behavior is required to store pasted data over post backs.
The table below lists the configurableClipboard behaviors of the WebDataGrid and WebHierarchicalDataGrid.
In ASPX:
<ig:WebDataGrid ID="wdg1" runat="server"> <Behaviors> <ig:Clipboard /> </Behaviors> </ig:WebDataGrid>
In C#:
Clipboard gridClipboard = this.WebDataGrid1.Behaviors.CreateBehavior<Clipboard>();
In Visual Basic:
Dim gridClipboard As Clipboard = Me.WebDataGrid1.Behaviors.CreateBehavior(Of Clipboard)()
The copy operation can be turned on or off independently of the other behaviors. The cut and paste behaviors can be individually configured as well. In order to only allow copying, you must disable the cut and paste operations. All clipboard features are turned on by default when adding the Clipboard behavior.
The table below maps the desired behaviors to property settings. The properties are accessed through the WebDataGrid’s Clipboard behavior.
Allowing only copy operations can be seen in the grid as a result of the following settings:
For detailed information about these properties, refer to their listing in the property reference section:
You can configure the Clipboard behavior to copy the column header information so that when the values are pasted into another application such as Excel®, the data is pasted underneath the copied header information.
The table below maps the desired behaviors to property settings. The properties are accessed through the Clipboard behavior.
Following are some other topics you may find useful.