Questions tagged [datagridtemplatecolumn]

Represents a DataGridColumn customizable implementation

Learn more about DataGridTemplateColumn on MSDN.

275 questions
2
votes
3 answers

Clear TextBlock from Button when they both are in a DataGridTemplateColumn

I have a DataGrid with DataGridTemplateColumn. The DataGridTemplateColumn contains a button and TextBlock. I want that pressing the button will clear the textBlock's text. How do I do that ? XAML:
Erez
  • 6,405
  • 14
  • 70
  • 124
2
votes
1 answer

Silverlight, datagrid, autogenerated columns on modified column change cell visibility of content

I have a form, it has a grid. I autogenerate the columns and tweak them as required: if (e.PropertyName == "id") { System.Windows.Style style = new Style(typeof(DataGridCell)); style.Setters.Add(new…
BugFinder
  • 17,474
  • 4
  • 36
  • 51
2
votes
3 answers

In the built-in WPF DataGrid, can I set the datasource for a DataGridTemplateColumn?

In this hypothetical example, imagine I have an object FooSet that has five properties Foo1, Foo2, Foo3 Foo4 and Foo5 all of which are type Foo which itself has several properties. Finally, I have a DataTemplate called FooTemplate that knows how to…
Mark A. Donohoe
  • 28,442
  • 25
  • 137
  • 286
2
votes
2 answers

How to conditionally hide elements in a TemplateColumn of a WPF DataGrid?

Context: a C# 4.0 WPF application with a datagrid that has one TemplateColumn showing a progress bar. How can one get the grid to only display the progress bar for certain items based on a condition? Maybe listening to the events and hiding the…
Cilvic
  • 3,417
  • 2
  • 33
  • 57
2
votes
2 answers

How can I add combo Box In a Table cell using LWUIT -- J2ME?

I want to add a combo Box in table cell to provide drag n drop option LWUIT. I have used this option for it .. private String strCmbBox[] = { "1", "2", "3", "4" }; ComboBox comboRdoBox = new ComboBox(strCmbBox); …
2
votes
1 answer

WPF DataGrid TemplateColumn with CheckBoxes and Select All -checkbox in header using MVVM Light

i'm trying to create a DataGrid with a column of checkboxes. On that CheckBox-column's header, i'd like to have a "check/uncheck all"-type of checkbox. App is using WPF, .NET 4 and MVVM Light. Here's the code: XAML:
juarola
  • 689
  • 2
  • 10
  • 20
2
votes
1 answer

Edit DataGridTemplateColumn in Code Behind?

I would think that this would be incredibly simple, but I've searched all over and can't seem to find an answer. I have a DataGridTemplateColumn that I want to use to display a value that isn't in the DataContext of the DataGrid. I.e. I have an…
vbullinger
  • 4,016
  • 3
  • 27
  • 32
2
votes
1 answer

Strange behavior with CheckBox in DataGridTemplateColumn

I have a SL4 DataGrid with a column containing a checkbox:
tobewan
  • 189
  • 2
  • 9
2
votes
1 answer

Style DataGridTemplateColumn to Match DataGridComboBoxColumn

EDIT (clarification of requirements) I have a DataGrid as shown below. The values in the "Field Name To Store Old EmpNo" column change based on the value selected in "New EmpNo Rule" column. To accommodate this, each item in the DataGrid…
BrianKE
  • 4,035
  • 13
  • 65
  • 115
2
votes
1 answer

Dynamic DataGrid columns in WPF DataGrid based on the underlying set of data (and their type)

I've got kind of a conceptual question. I am in the process of wrapping some statistics classes I wrote into WPF. For that I have two DataGrid(-Views, currently in WinForms). In one DataGrid each row represents a column in the other. There I can…
StatsMan
  • 21
  • 2
2
votes
1 answer

How can I center a Silverlight DataGridTemplateColumn header?

I want to center the header on a Silverlight DataGridTemplateColumn. The following code gets me most of the way there: DataGridTemplateColumn column = new DataGridTemplateColumn(); column.CellTemplate = Resources[templateName] as…
Mike Pateras
  • 14,715
  • 30
  • 97
  • 137
2
votes
1 answer

Sorting Datagrid with DataGridTemplateColumn

I am using a DataGrid and the ItemSource is Bound to a list of strings. The problem is that the sorting is not working. The header is enabled and can be clicked but the data is not sorted.
gerstla
  • 587
  • 1
  • 5
  • 20
2
votes
1 answer

Wpf Centering Cell content in DataGridTemplateColumn

I am able to center the header without any problems but the cell with the checbox... if I set it to HorizontalAlignment=Center it shows all the way in the left, if I change it to HorizontalContentAlignemnt=Center it shows all the way to the right...…
jedgard
  • 868
  • 3
  • 23
  • 41
2
votes
1 answer

Bound combobox: text disappearing after sorting the source list of strings

Ive got an ObservableCollection list, which is bound to a combobox. This combobox is in a datatemplate which is inside a 'DataGridTemplateColumn'. When the datagrid is displayed (with all the rows), the column displaying this combobox works…
user281794
  • 163
  • 1
  • 1
  • 8
2
votes
2 answers

DataGridTemplateColumn ComboBox Binding

I have a DataGrid bound to a collection of Employees. Employee class has an EmployeeCountry of type Country. Country type consists of CountryId and CountryName. I have the following XAML:
Lucifer
  • 2,317
  • 9
  • 43
  • 67