Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
395
Xamdatagrid field visibility
posted

I am trying to hide the column from the data grid by changing the visibility value of the field but, the column is still there as a placeholder, only the data on it goes invisible. 

What am I missing ? 

 <infragistic:XamDataGrid Grid.Row="1" DataSource="{Binding LayerList }" PreviewKeyDown="DataGrid_PreviewKeyDown" Name="InputLayersDataGrid"
                            GroupByAreaLocation="None">

                                            <infragistic:XamDataGrid.FieldLayoutSettings>
                                                <infragistic:FieldLayoutSettings AutoGenerateFields="False" 
                                            AutoFitMode="Always" 
                                            AddNewRecordLocation="OnTopFixed"
                                            AllowAddNew="False"
                                            SupportDataErrorInfo="RecordsAndCells"
                                            DataErrorDisplayMode="Highlight"
                                            AllowDelete="True" SelectionTypeRecord="Single"/>
                                            </infragistic:XamDataGrid.FieldLayoutSettings>
                                            <infragistic:XamDataGrid.Resources>
                                                <Style x:Key="{x:Type infragistic:DataRecordCellArea}" TargetType="{x:Type infragistic:DataRecordCellArea}">
                                                    <Style.Triggers>
                                                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Record.DataItem.IsOk, UpdateSourceTrigger=PropertyChanged}"  Value="false">
                                                            <Setter Property="BorderBrush" Value="#FFFFDC00"/>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                                <Style  x:Key="style" TargetType="{x:Type infragistic:LabelPresenter}">
                                                    <Setter Property="Visibility" Value="{Binding DataContext.Is3D, RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Converter ={StaticResource InverseBooltoVis}}"/>
                                                </Style>
                                            </infragistic:XamDataGrid.Resources>
                                            <infragistic:XamDataGrid.FieldLayouts>
                                                <infragistic:FieldLayout>
                                                    <infragistic:FieldLayout.Fields>
                                                        <infragistic:Field Name="TopHorizon" Label="Top horizon"></infragistic:Field>
                                                        <infragistic:Field Name="BottomHorizon" Label="Bottom horizon"></infragistic:Field>
                                                        <infragistic:Field Name="DepositionalMode" Label="Depositional mode"></infragistic:Field>
                                                        <infragistic:TemplateField Name="TopHorizonMarker" Label="Top horizon marker">
                                                            <infragistic:TemplateField.Settings>
                                                                <infragistic:FieldSettings LabelPresenterStyle="{StaticResource style}"/>
                                                            </infragistic:TemplateField.Settings>
                                                            <infragistic:TemplateField.EditorStyle>
                                                                <Style TargetType="{x:Type igEdit:XamNumericEditor}">
                                                                    <Setter Property="Visibility" Value="{Binding DataContext.Is3D, RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Converter ={StaticResource InverseBooltoVis}}"/>
                                                                </Style>
                                                            </infragistic:TemplateField.EditorStyle>
                                                            <infragistic:TemplateField.EditTemplate>
                                                                <DataTemplate>
                                                                    <controls:SearchableDropBox  DomainObject="{igEdit:TemplateEditorValueBinding UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True}" 
                                                                                            InputValidationManifest="{Binding Path=DataContext.SurfaceDataValidaton, RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Mode=OneWay}" 
                                                                                            ToolTipHeader="Target guide model data " ToolTipText="Select a supported seismic type" 
                                                                                            ToolTipService.IsEnabled="True" VerticalAlignment="Center" VerticalContentAlignment="Center"   HorizontalAlignment="Stretch"
                                                                                            
                                                                                            Validation.ErrorTemplate="{StaticResource CommonErrorTemplate}"
                                                                                            Name="GuideModelData"/>
                                                                </DataTemplate>
                                                            </infragistic:TemplateField.EditTemplate>
                                                            <infragistic:TemplateField.DisplayTemplate>
                                                                <DataTemplate>
                                                                    <controls:PresentationBox   Name="GuideModelData" DomainObject="{igEdit:TemplateEditorValueBinding UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True}"
                                                                                            Validation.ErrorTemplate="{StaticResource CommonErrorTemplate}"  ></controls:PresentationBox>
                                                                </DataTemplate>
                                                            </infragistic:TemplateField.DisplayTemplate>
                                                        </infragistic:TemplateField>
                                                    </infragistic:FieldLayout.Fields>
                                                </infragistic:FieldLayout>
                                            </infragistic:XamDataGrid.FieldLayouts>
                                        </infragistic:XamDataGrid>