datatemplate Questions

4

Solved

I am trying to learn something about WPF and I am quite amazed by its flexibility. However, I have hit a problem with Styles and DataTemplates, which is little bit confusing. I have defined below ...
Darlenedarline asked 19/3, 2010 at 9:59

1

I created a SplitPage view from canned templates that has the following ListView definition: <!-- Vertical scrolling item list --> <ListView x:Name="itemListView" AutomationProperties....

3

Solved

I have used the following template in my project: <DataTemplate x:Key="textBoxDataTemplate"> <TextBox Name="textBox" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=(Va...
Cavit asked 23/10, 2009 at 12:28

1

Let's say I have an items control that is bound to a list of items on the VM. Inside the datatemplate is a textbox. How would I set focus to the first textbox in either XAML or the VM? Thanks in ...
Concordant asked 1/5, 2013 at 21:51

1

Solved

I'm fairly new to XAML but enjoying learning it. The thing I'm really struggling with is binding a property to an element in a DataTemplate. I have created a simple WPF example to, (hopefully,) ex...
Chavey asked 1/4, 2013 at 17:48

1

Solved

I have the following simplified Example: <Window x:Class="TemplateBinding.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/...

1

Solved

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 e...
Hydranth asked 1/2, 2013 at 18:14

1

Solved

Is there a way how can I hide expand/collapse icon for all treeview? I found that icon should be hiding if there is no items for node. But I want to hide it everywhere in tree. I just want to expan...
Toughen asked 29/1, 2013 at 20:38

1

Solved

I'm binding the ItemsSource of my MenuItem to an ObservableCollection in my ViewModel. Here is my xaml: <MenuItem Header="_View" ItemsSource="{Binding Windows}"> <MenuItem.ItemContainer...
Justinjustina asked 23/1, 2013 at 20:49

3

Solved

The question: Is there a way to define a DataTemplate in XAML and instantiate it in code (rather than retrieve singleton by FindResource) and modify its VisualTree before sending to where a DataTe...
Beef asked 22/12, 2012 at 7:17

5

Solved

Problem: Displaying large amounts of data in a scrollable area has horrible performance and/or User eXperience. Tried: Basically set a DataTemplate in a ListBox to show a grid of populated data wi...
Quantifier asked 14/12, 2012 at 4:27

5

Solved

Is there any easy way to bind to the ToString() method in a DataTemplate? I would expect the Text property of a TextBlock to use ToString() by default for its Text property, but that does not happe...
Skid asked 29/11, 2012 at 15:23

1

Solved

I have some controls in a DataTemplate and I'd like to control it's pressed state behaviour. I did the following where I just put in VisualStateManager in the DataTemplate but it doesn't seem to wo...

1

Solved

I know there a lot of topics related to this question but I could not find a solution that fits perfectly for my problem ... maybe there is none? At the moment I have a UserControl which holds a ...
Fabre asked 6/11, 2012 at 7:49

6

Solved

I have a ListBox with it's ItemTemplate bound to a DataTemplate. My problem is I cannot get the elements in the template to stretch to the full width of the ListBox. <ListBox x:Name="listPeople...
Lactiferous asked 14/4, 2009 at 3:0

2

Solved

I have a control that I am unable to access in the codebehind, and I believe it is because it is defined in a DataTempalte. The overall control is a slide show carousel. Each slide can be an Image...
Noteworthy asked 31/10, 2012 at 20:11

2

Is it possible to use the same DataTemplate for a defined selection of types, i.e. how to change the following sample code so that the same DataTemplate is used for all listed types? <DataTempl...
Archaeopteryx asked 15/10, 2012 at 16:1

1

Solved

Can a DataTemplate in XAML be associated with a nested class? I am working on a MVVM application, and I have run into a data template problem. I have a view model providing a collection of other v...
Koloski asked 9/10, 2012 at 18:46

1

I am trying to create a User Control that represents what I am calling a workspace (a reference from a blog by Josh Smith). The workspaces will be displayed in a tab control. I am aiming to use a t...
Pantile asked 14/9, 2012 at 21:13

3

Solved

ASP.NET controls like ListView allows providing a custom template by setting the ListView.EmptyDataTemplate property, this template will be rendered in case of empty data source. How to do the sam...
Reichenberg asked 16/11, 2011 at 15:32

1

Solved

I need to display Hierarchy in the treeview. But Details should be displayed in the datagrid. How do I have to write my template to achieve this? I misunderstand smth in templates for now. &lt...
Whitelaw asked 13/8, 2012 at 16:40

3

Solved

As explained in the following article http://vbcity.com/blogs/xtab/archive/2009/12/15/wpf-using-a-virtualizingstackpanel-to-improve-combobox-performance.aspx, I use the VirtualizingStackPanel to im...
Clunk asked 13/8, 2012 at 15:16

3

Solved

In MVVM, every View has a ViewModel. A View I understand to be a Window, Page or UserControl to which you can attach a ViewModel from which the view gets its data. But a DataTemplate can also rend...
Forgetmenot asked 19/6, 2009 at 7:58

4

Solved

I have DataTemplate containing a TextBox. I'm setting this template to a listbox item on a selection. I'm unable to set focus to textbox in the template. I tried to call MyTemplate.FindName, but i...
Counterstatement asked 30/11, 2008 at 22:59

2

Solved

I have a data-template <Window.Resources> <DataTemplate x:Key="BarChartItemsTemplate"> <Border Width="385" Height="50"> <Grid> <Rectangle Name="rectangleBarChart" F...
Facia asked 6/8, 2012 at 10:11

© 2022 - 2024 — McMap. All rights reserved.