Version

DisallowModificationViaClipboard Property

Returns or sets a value indicating whether clipboard operations that would attempt to modify the value of the cell should be skipped.
Syntax
'Declaration
 
Public Property DisallowModificationViaClipboard As Boolean
public bool DisallowModificationViaClipboard {get; set;}
Remarks

DisallowModificationViaClipboard specifies whether to ignore clipboard operations on cells of this field and has a default value of false. If set to True, any clipboard operations that will end up modifying the cell values will be ignored for the cells associated with this field. This is useful for read-only or ID columns when you would typically not want to allow cutting/pasting on cells of such columns.

Note that operations that do not modify the values, such as Copy operation, will still be allowed on the associated cells.

Example
The following sample demonstrates how to use the DisallowFieldModificationsViaClipboard to ensure that a unique id field not be modified by a cut, clear or paste operation.

xmlns:igDP="http://infragistics.com/DataPresenter"

<igDP:XamDataGrid
        
IsUndoEnabled="True"
        
x:Name="XamDataGrid1">
    
<igDP:XamDataGrid.FieldLayoutSettings>
        
<igDP:FieldLayoutSettings 
                
AllowClipboardOperations="All" 
                
CopyFieldLabelsToClipboard="True" />
    
</igDP:XamDataGrid.FieldLayoutSettings>

    
<igDP:XamDataGrid.FieldLayouts>
        
<!-- Orders FieldLayout -->
        
<igDP:FieldLayout>
            
<igDP:FieldLayout.Fields>
                
<!-- DisallowModificationViaClipboard is set to avoid changing a 
                        primary key field's value when cut/pasting/clearing cell contents 
-->
                
<igDP:Field 
                        
Name="OrderID" 
                        
DisallowModificationViaClipboard="True" />
                
<igDP:Field Name="CustomerID" Visibility="Collapsed" />
                
<igDP:Field Name="EmployeeID" Visibility="Collapsed" />
            
</igDP:FieldLayout.Fields>
        
</igDP:FieldLayout>

    
</igDP:XamDataGrid.FieldLayouts>
</igDP:XamDataGrid>
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, 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