Version

Settings Property (Field)

Gets/sets an object that holds specific settings for this field.
Syntax
'Declaration
 
Public Property Settings As FieldSettings
public FieldSettings Settings {get; set;}
Remarks

FieldSettings are exposed via the following 3 properties:

Refer to the Fields topic in the Developer's Guide for an explanation of fields.

Refer to the Field Settings topic in the Developer's Guide for an explanation of the FieldSettings object.

Refer to the Theory of Operation topic in the Developer's Guide for an explanation of how this object is used.

Example
The following example demonstrates how to associate a custom Style for a particular field using the CellValuePresenterStyle of the Settings. In this example, there are 2 custom CellValuePresenter styles. One is set up to use a custom style that uses a Button for the template of each cell. The other uses a Hyperlink for the template of the cell. Note, you will need to handle the routed events for these objects (e.g. Button.Click and Hyperlink.RequestNavigate).
<igDP:XamDataGrid BindToSampleData="True">

    
<igDP:XamDataGrid.Resources>
        
<!-- hyperlink cell -->
        
<!-- Note - you'll need to handle the routed Hyperlink.RequestNavigate to process the clicking on a link -->
        
<Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="hyperlinkCell">
            
<Setter Property="Template">
                
<Setter.Value>
                    
<ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                        
<TextBlock Margin="{TemplateBinding Padding}">
                            
<Hyperlink NavigateUri="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Value}">
                                
<TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Value}"/>
                            
</Hyperlink>
                        
</TextBlock>
                    
</ControlTemplate>
                
</Setter.Value>
            
</Setter>
        
</Style>

        
<!-- button cell -->
        
<!-- Note - you will need to handle the routed Button.Click event  -->
        
<Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="buttonCell">
            
<Setter Property="Template">
                
<Setter.Value>
                    
<ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                        
<Button Content="{TemplateBinding Content}" />
                    
</ControlTemplate>
                
</Setter.Value>
            
</Setter>
        
</Style>

    
</igDP:XamDataGrid.Resources>
    
    
<igDP:XamDataGrid.FieldLayouts>
        
<igDP:FieldLayout>
            
<igDP:FieldLayout.Fields>
                
<igDP:Field Name="name" />
                
<igDP:Field Name="department">
                    
<igDP:Field.Settings>
                        
<igDP:FieldSettings CellValuePresenterStyle="{StaticResource buttonCell}"/>
                    
</igDP:Field.Settings>
                
</igDP:Field>
                
<igDP:Field Name="salary"/>
                
<igDP:Field Name="email">
                    
<igDP:Field.Settings>
                        
<igDP:FieldSettings CellValuePresenterStyle="{StaticResource hyperlinkCell}"/>
                    
</igDP:Field.Settings>
                
</igDP:Field>

            
</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