Hi,
I am writting the control Template of HeaderPrefixArea as below:
<Style TargetType="{x:Type igDP:HeaderPrefixArea}"><Setter Property="Visibility" Value="Visible"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igDP:HeaderPrefixArea}">
<Grid> <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" /></Grid>
</ControlTemplate></Setter.Value></Setter></Style>
Now if I set HeaderPrefixAreaDisplayMode="FieldChooserButton", it is not appeared at all in the prefix area.
<eclp:EclpGrid.FieldLayoutSettings><igDP:FieldLayoutSettings SelectionTypeRecord="Single" AutoGenerateFields="False" HighlightAlternateRecords="True" HeaderPrefixAreaDisplayMode="FieldChooserButton" ></igDP:FieldLayoutSettings></eclp:EclpGrid.FieldLayoutSettings><eclp:EclpGrid.FieldLayouts>
If I comment the Style, it works. Kindly suggest.
Thanks for your support.
It works.
Ritesh
The style you can find in the DataPresenterGeneric_Express file. Here is the default style anyway:
<Style TargetType="{x:Type igDP:HeaderPrefixArea}">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<!--<Setter Property="Visibility" Value="Hidden"/>-->
<Setter Property="Visibility" Value="Visible"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type igDP:HeaderPrefixArea}">
<StackPanel Orientation="Horizontal" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
<!--Button that displays field chooser-->
<Button
x:Name="fieldChooserButton"
Style="{DynamicResource {x:Static igDP:DataPresenterBase.FieldChooserButtonStyleKey}}"
Command="{x:Static igDP:DataPresenterCommands.ShowFieldChooser}"
CommandParameter="{TemplateBinding FieldLayout}"
Visibility="Collapsed"/>
<ContentPresenter
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
</StackPanel>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=FieldLayout.HeaderPrefixAreaDisplayModeResolved}" Value="FieldChooserButton">
<Setter TargetName="fieldChooserButton" Property="Visibility" Value="Visible" />
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Thanks for your response but I couldn't find any style for HeaderPrefixArea.
It would be great if you could provide some example to get default behavior.
Hello,
When you are retemplating an element, we recommend that you get the default style and create your own based on it to keep all the functionality. The default style for this HeaderPrefixArea you can find in the DefaultStyles directory in the Infragistics folder.