<CheckBox IsEnabled="{Binding ShowGuideWeight}"></CheckBox> <infragistic:XamDataGrid Grid.Row="1" DataSource="{Bindng LogList }" PreviewKeyDown="DataGrid_PreviewKeyDown" Name="InputGlobalWellsDataGrid" GroupByAreaLocation="None"> <infragistic:XamDataGrid.FieldLayoutSettings> <infragistic:FieldLayoutSettings AutoGenerateFields="False" AutoFitMode="Always" AddNewRecordLocation="OnTopFixed" AllowAddNew="True" SupportDataErrorInfo="RecordsAndCells" DataErrorDisplayMode="Highlight" AllowDelete="False" 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> </infragistic:XamDataGrid.Resources> <infragistic:XamDataGrid.FieldLayouts> <infragistic:FieldLayout> <infragistic:FieldLayout.Fields> <infragistic:Field Name="Name" Label="Name"></infragistic:Field> <infragistic:Field Name="GuideWeight" Label="Guide weight"> <infragistic:Field.EditorStyle> <Style TargetType="{x:Type igEdit:XamNumericEditor}"> <Setter Property="Visibility" Value="{Binding DataContext.ShowGuideWeight, RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Converter ={StaticResource boltoVis}}"/> </Style> </infragistic:Field.EditorStyle> </infragistic:Field> </infragistic:FieldLayout.Fields> </infragistic:FieldLayout> </infragistic:XamDataGrid.FieldLayouts> </infragistic:XamDataGrid>
I manage tho change the visibility of the cell but, how can I collapse the whole column (I also want to hide the header,) The visilibty of that clown show depend on the click of the checkbox
private void CheckBox_Checked(object sender, RoutedEventArgs e) { this.grid.FieldLayouts[0].Fields["Height"].Visibility = Visibility.Collapsed; }