gridviewcolumn

GridViewColumn content and VerticalAlignment

hi there, i want to display some information in a listview using the GridView. i have several GridViewColumns and everything works fine. However, want the GridViewColumns content to have a VerticalAlignment (Top in this case) but the gridvewcolumn intself doesnt offer a VerticalContentAlignment dependency property. when using DisplayM...

WPF: Problem with binding values to ComboBox inside GridViewColumn

My Views dataContext is bounded to a presentationModel with two observableCollections Members. In the View I have one listView which ItemSource is bound to is the first observableCollection. In one of the LilstViews column I want to present values from the second obeservable Colletion in my presentationModel. I cant figure out how to get...

asp.Net GridView bind custom object with nested List

Hi All, I have a List of custom object, which consist of a custom list. class person{ string name; int age; List<friend> allMyFriends; } class friend{ string name; string address; } I'trying to bind a list of these objects to a GridView and the Grid should create for each friend a column and write the name in it. If some p...

TreeListView with Columns generated and populated by ObservableCollection

Does anyone known (or even has an example) of a WPF based TreeListView that can generate its colums by databinding to the ObservableCollection of its tree items? For example the databound model is a tree consisting of Employee instances representing the supervisor hierarchy of a company. Each employee addtionally has a ObservableCollec...

WPF: How to freeze a ListView header row so that it won't scroll off the screen

Hi, I am new to WPF development, I have a ListView and I want to freeze the header row so that it won't scroll off the screen when the user scrolls the list. The xaml code, I have inherited, looks something like this: <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> <DockPanel> <forms:Bindable...

C#/WPF: Make a GridViewColumn Visible=false?

Does anyone know if there is an option to hide a GridViewColumn somehow like this: <ListView.View> <GridView> <GridViewColumn Header="Test" IsVisible="{Binding Path=ColumnIsVisible}" /> </GridView> <ListView.View> Thanks a lot! Edit: For clarity Unfortunately, there is no "IsVisible" Property. I'm looking for a way t...

Programmatically replace GridView cell contents on load

I am working on a program in WPF for the first time. I have a ListView in GridView mode displaying data from a bound dataset (which is grabbed from a database). In my database, "date of birth" is not a required field. As such, any record without a dob had the value set to DateTime.MinValue. On each of these minimum value dates, the date...

Access TextBlock binding path programatically

This is a follow-up question to my previous one about replacing GridView contents programmatically. I have a GridView displaying a DataSet. All of my columns are bound in my xaml with DisplayMemberBinding: <GridViewColumn DisplayMemberBinding="{Binding Path=FirstName}" Header="First Name" ...

Gridview and Column sets

I have a Gridview that is data bound to an array of objects, with a ton of properties attached to them. The grid would need to be too wide to show all of them at once (and also overwhelming for the user), so I'd like to have some link buttons that post back to the server and show different sets of columns (all from this same data set ar...

Programatically binding a header in a Gridview

I have a datatable being built in code which can dynamically have any given number of columns. I have to group the rows within the Gridview by adding a new TableRow based on the first column. This requirement means I can't use the AutoGenerateColumns. I've create a table within an ItemTemplate which I'm using to bind the rows/cells again...

In wpf treeview, how to redraw the nodes with their previous expanded values(using MVVM)

Hi to all, I am developing a wpf desktop app with strict MVVM pattern. Current my app is doing following things: Showing a Treeview with HierarchicalDataTemplate. User can expand or collapse Nodes. User can add add new Nodes(Drag n Drop + double click). Everytime a new Node is added Model is updated and Treeview ...

WPF Check/Uncheck all checkboxes located in a gridview

Hi! I have a gridview with some columns. One of these columns is checkbox type. Then I have two buttons in my UI, one for check all and another for uncheck all. I would like to check all checkboxes in the column when I press the a button and uncheck all checkboxes when I press the another one. How can I do this? Some snippet code: ...

How to get x:Name value runtime

I got: <ListView.View GridViewColumnHeader.Click="ColumnHeaderClick"> <GridView> <GridViewColumn x:Name="Col" Header="Item"> private void ColumnHeaderClick(object sender, RoutedEventArgs e) { GridViewColumnHeader headerClicked = e.OriginalSource as GridViewColumnHeader; } Now, how to get ...

How to Set a gridview column width when binding to a datatable

I am binding a table to a gridview in asp.net as such grdIssues.DataSource = mdtIssues; grdIssues.DataBind(); The problem is I cannot then control the column width, asp.net seems to decided on it's own what width each column should be. Methods such as grdIssues.Columns[0].ItemStyle.Width = 100; grdIssues.Columns[1].ItemStyle.Wid...

Access Parent Property from inside Headertemplate

Hi, How to access a parent proeprty from inside a headertemplate.I have overrided the gridviewcolumn class and add some custom properties to it.Now inside my headertemplate of listview i want to access this custom property using which a button shold be made visible or collpsed.I tried templatedparent and Findancestor but i cant get to th...

Access GridViewColumnHeader object from GridViewColumn

Hi, is it possible in wpf to access the header of a gridviewcolumn as gridviewcolumnheader? I have an object: GridViewColumn column; But the "Header" property just returns a string (header text) not the "real" header object. Can anyone help my? ...

Multiple databound controls in a single GridView column

I have a grid view that is data bound to a dataset. In a grid I have a column DefaultValue, which has three controls in it - a dropdownlist, a checkbox and a textbox. Depending on the data that is coming in it can switch to any of these controls. Everything is simple enough when we need just to display data - in gridview_prerender event ...

Where can i find the default WPF Control templates?

As per this MSDN link, There is no way to replace only part of the visual tree of a control; to change the visual tree of a control you must set the Template property of the control to its new and complete ControlTemplate . I am trying to disable the click behaviour of GridViewColumnHeader ( I need to remove some trigge...

Access control binding information from GridViewColumn

I have code like this <GridViewColumn Header="Status" Width="75" DisplayMemberBinding="{Binding Path=TimesheetStatus}"/> <GridViewColumn Header="Reviewed?" Width="70"> <GridViewColumn.CellTemplate> <DataTemplate> <CheckBox Margin="1,2,1,0" IsEnabled="{Binding Path=EnableReview}" IsChecked="{Bi...

How to access the element within the DataTemplate of GridViewColumnHeader?

Hello!! How can I get access to an element (TextBlock) within the DataTemplate of GridViewColumnHeader from the code???? I want to set focus on the column header. ...