Questions tagged [datagridtemplatecolumn]

Represents a DataGridColumn customizable implementation

Learn more about DataGridTemplateColumn on MSDN.

264 questions
96
votes
3 answers

How can I sort a DataGridTemplateColumn on a WPF Toolkit DataGrid?

I have a WPF Toolkit DataGrid with one DataGridTemplateColumn. I've specified in a grid attribute that I wish all columns to be sortable, but the DataGridTemplateColumn won't allow it. All other columns do allow sorting. I've even tried explicitly…
Kilhoffer
  • 30,901
  • 20
  • 91
  • 123
21
votes
5 answers

WPF - How to bind a DataGridTemplateColumn

I am trying to get the name of the property associated with a particular DataGridColumn, so that I can then do some stuff based on that. This function is called when the user clicks context menu item on the column's header... This is fine for the…
Andy T
  • 1,741
  • 7
  • 19
  • 24
20
votes
4 answers

WPF Datagrid -DataGridTemplateColumn tab focus issue

I am using Microsoft WPF datagrid. I have noticed a strange behavior with WPF datagrid DataGridTemplateColumn. When you use the templateColumn in the grid and the template column contains some controls when you tab from the previous column the focus…
None
18
votes
5 answers

DataGridTemplateColumn (ComboBox, DatePicker) Resets/Clears and doesn't fire AddingNewItem

I've narrowed down the problem to the following example that has a DataGrid with three columns. XAML:
17
votes
1 answer
17
votes
2 answers

DataGridTemplateColumn Two way binding is not working

I've got a datagrid I've bound to a SqlDataApter. If I set up the XAML for the grid using DataTextColumn as illustrated in the code below it works perfectly
16
votes
2 answers

How to reuse WPF DataGridTemplateColumn (including binding)

In WPF datagrids, I have a column defined as DataGridTemplateColumn which I'll need to be using on all kinds of columns. As a very simplified example please consider the below as a dummy sample:
Tony Campney
  • 175
  • 1
  • 1
  • 6
14
votes
1 answer

Binding DataGridTemplateColumn

Seems I've hit a wall trying to use DataTemplates on my DataGrid. What I'm trying to do is to use one template to show two rows of text for each cell. But it doesn't seem to be possible to Bind the column in any way. Following code hopefully shows…
ari k
  • 169
  • 1
  • 8
13
votes
1 answer

How do I add multiple controls to a DataGridTemplateColumn of a datagrid using wpf?

I have several instances where I would like to have several controls in a single column in a datagrid. For example, I have a dataset that contains images with matching description, image source, timestamp, geotag, etc. I would like to display this…
IanM
  • 217
  • 2
  • 3
  • 8
11
votes
4 answers

WPF DataGridTemplateColumn with ComboBox Binding (MVVM pattern)

I'm going bonkers with the following WPF DataGrid+ComboBox scenario. I have a set of classes which look like; class Owner { int ID { get; } string Name { get; } public override ToString() { return this.Name; } } class…
RJ Lohan
  • 6,257
  • 3
  • 30
  • 52
11
votes
2 answers

What is the code behind for datagridtemplatecolumn, and how to use it?

I have a DataGrid in WPF. And I am trying to add Buttons to certain cells of the grid, after it is bound to a particular ItemsSource. I have tried to do this in the xaml like this:
Gagan
  • 317
  • 3
  • 7
  • 18
8
votes
1 answer

WPF DataGrid cell string format as a style or template

I tried several ways to factor out the format of a cell in a WPF DataGrid (the one provided with .NET 4): a data converter, the "StringFormat" binding property within a style, the "StringFormat" binding property within a data template. I will…
8
votes
1 answer

How to get value of a programmatically written combobox in a datagrid in wpf?

To follow my previous post here => Binding SelectedItem of ComboBox in DataGrid with different type I have now a datagrid containing 2 columns, one with a text, the other with a combobox (in a datatemplate, written thru the C# code, not the Xaml).…
PetersLast
  • 157
  • 3
  • 16
8
votes
1 answer

How to access datagrid template column textbox text WPF C#

I need to access the text in a DataGrid's template column from code behind, but I don't know how. I need to change the text to whatever string I pass to it on the SelectionChanged event. Can someone please tell me how to achieve this? I found a…
acosta
  • 89
  • 1
  • 1
  • 7
7
votes
1 answer

WPF DataGrid how to set ColumnType to different type based on bound data?

I have "Preferences" data structure where I have string "Value" field and enum for "Type" field. Type can be 0-Boolean, 1-Integer, 2-String ... Depending on value in this Type field I'd like to display "Value" cell different way Checkbox, Textbox,…
katit
  • 15,901
  • 32
  • 116
  • 238
1
2 3
17 18