Hi,All
How to hide column in DataGrid for wpf.
Thanks.
A field has a Visibility flag which can be set declaratively (XAML) or via code. I assume, you want to do this in code - here's a dummy snippet that shows/hides the first column of a given grid:
Field field = myGrid.FieldLayouts[0].Fields[0]; if (field.Visibility == Visibility.Visible) { field.Visibility = Visibility.Collapsed; } else { field.Visibility = Visibility.Visible; }
hth