WPF: How to hide GridViewColumn using XAML?

Actually, I find the easiest solution is via attached properties: public class GridViewColumnVisibilityManager { static void UpdateListView(ListView lv) { GridView gridview = lv.View as GridView; if (gridview == null || gridview.Columns == null) return; List<GridViewColumn> toRemove = new List<GridViewColumn>(); foreach (GridViewColumn gc in gridview.Columns) { if (GetIsVisible(gc) == false) { toRemove.Add(gc); } } foreach (GridViewColumn … Read more

ListView.GridViewColumn (*) width

Please try that solution: <ListView> <ListView.View> <GridView> <GridViewColumn Header=”column1″ x:Name=”col1″/> <!–Column that shall resize: Width is set to the Actual Width of the helper field defined below–> <GridViewColumn Header=”column2″ Width=”{Binding ElementName=helperField, Path=ActualWidth}”/> </GridView> </ListView.View> Test Text </ListView> <!–This is the hidden helper Grid which does the resizing –> <Grid Visibility=”Hidden”> <Grid.ColumnDefinitions> <!–Width is bound to … Read more

How to autosize and right-align GridViewColumn data in WPF?

To make each of the columns autosize you can set Width=”Auto” on the GridViewColumn. To right-align the text in the ID column you can create a cell template using a TextBlock and set the TextAlignment. Then set the ListViewItem.HorizontalContentAlignment (using a style with a setter on the ListViewItem) to make the cell template fill the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)