Questions tagged [celltemplate]

91 questions
18
votes
1 answer

DataTemplate for each DataType in a GridViewColumn CellTemplate

I have an ObservableCollection which contains view models of multiple types, and I would like to make a DataTemplate for each type within each of my GridViewColumn's CellTemplates. In this simple example I could create a base ViewModel, but I would…
scuba88
  • 458
  • 2
  • 4
  • 13
7
votes
1 answer

Can I define CellTemplate of DataGrid as a Resource so that it can be reused in multiple columns?

I want a specific template for all my columns in DataGrid. The usual method is I will replicate the entire XAML for DataTemplate multiple times in the DataGrid in each of the Column. Is there any way I can define the CellTemplate globally as a…
teenup
  • 7,459
  • 13
  • 63
  • 122
6
votes
1 answer

Inheriting WPF DataGrid styles in a custom CellTemplate

I wish to have a custom column type in a WPF datagrid, part of which will be a textbox for user input. Unfortunately, it does not appear to inherit the look and feel of the datagrid itself- it doesn't show the alternating colour, when a row is…
Ricardo Campos
  • 481
  • 4
  • 9
4
votes
2 answers

How to trigger cellTemplateSelector when Items changed

I have 2 templates for DataGrid's CellTemplate. When I change the items, it won't help me select the template for me, my DisplayModeTemplateSelector won't even be called! What I'm wondering is if there is a way to trigger this CellTemplateSelector…
CodingTT
  • 1,125
  • 3
  • 14
  • 23
4
votes
3 answers

ngGrid cellFilter and cellTemplate do not work together

I use ngGrid to display my data. I would like to use cellFilter and cellTemplate together for the specific column, but seems they do not work together. when I use cellFilter or cellTemplate seperately they work perfect. Basically, I would like to…
4
votes
2 answers

DataTemplate defined in XAML has null VisualTree

I'm using WPF with .NET 3.0. I have a relatively simple DataTemplate defined as the CellTemplate for a GridView. I expect the DataTemplate's VisualTree property to contain a FrameworkElementFactory, but the property is null when I try to access it…
atoumey
  • 2,536
  • 2
  • 20
  • 16
4
votes
1 answer

How to set a specific Datacontext for a DataTemplate in CellTemplate

Currently i bind to a List so i have to do specific set foreach Column a separate DataTemplate like this:
WiiMaxx
  • 5,322
  • 8
  • 51
  • 89
4
votes
2 answers

Is it possible to parameterize the binding on a DataGrid CellTemplate in a resource?

I'm putting together some generic CellTemplate styles for a WPF grid (WPFToolKit DataGrid), and I’m not sure of the syntax to use to make the binding generic. So for example, I have this template, which turns the value red if the value is negative:…
Webreaper
  • 509
  • 4
  • 18
3
votes
0 answers

Overriding the cell templates of a WPF GridViewRowPresenter

I'm producing a custom control that uses a GridViewRowPresenter in a similar way to the way that the ListView does - binding to the Columns collection of a View property on my control which is of type ViewBase:
Justin
  • 84,773
  • 49
  • 224
  • 367
3
votes
2 answers

ng-repeat not working for list of strings using custom directive

I am working on angular js project in which we are using ng-repeat to display list of strings in cell template created using custom directives. It working fine for list of numbers. But it does not works for list of strings. You can try by changing…
3
votes
1 answer

ng-grid cellTemplate issue with background color of cell

When I have a value as an empty string "" in the data and I use background color in cellTemplate it does not color enitire cell. Here is the plunke that illustrates the issue. http://plnkr.co/edit/TP4VH9xA7qCFT8xgNKW8?p=preview Can someone help me…
swe
  • 143
  • 3
  • 11
3
votes
1 answer

WPF DataGrid: CellEditingTemplate ComboBox multiple data to CellTemplate TextBox

I have googled around but with very limited luck. I have a question regarding editable WPF DataGrid; in a CellEditingTemplate a ComboBox is shown, but in CellTemplate a TextBox with corresponding ComboBox value is shown. My code looks something like…
dabor
  • 127
  • 1
  • 3
  • 13
2
votes
2 answers

WPF DataGrid: Selecting CellTemplate by DataType of ItemsSoure

I am Building a DataGrid where i want to switch the images inside a cell based on the underlying datatype of the current item. Question: Is it possible to apply this type of template switching? Preferably in xaml-only? ItemsSource…
Daniel
  • 95
  • 2
  • 9
2
votes
1 answer

Access ListView CellTemplate UIElements

i am making a simple list with few options. This is how it looks like: Buttons appear when hit the listviewitem and disappear when leave When press Play, then this button stays Visible and Content changes to Stop My problems is: When i press…
b00sted 'snail'
  • 354
  • 1
  • 13
  • 27
2
votes
1 answer

ng-grid tally multiple columns

My data has more fields than my page has columns. I need to sum fields into the columns. The JSON I have: { 'foo1' : 10, 'foo2' : 11, 'foo3' : 5, 'bar1' : 23, 'bar2' : 2, 'baz1' : 53, 'baz2' : 43 },{ 'foo1' : 11, 'foo2' : 41, …
DaveC426913
  • 2,012
  • 6
  • 35
  • 63
1
2 3 4 5 6 7