celltemplate

WPF Dynamic DataTemplate: GridView CellTemplate is not null but VisualTree property is null

I am trying to set the DataTemplate of my ListView.GridView's CellTemplate dynamically at runtime. The problem is when I do this, nothing happens. I checked the CellTemplate and it's not null but its VisualTree property is null. Any suggestions? GridViewColumn gvc = new GridViewColumn { Header = col.Label ?? col.Name, ...

Silverlight - Access the Layout Grid's DataContext in a DataGrid CellTemplate's DataTemplate?

Hi, I am using Silverlight 3 to develop an application. In my app, I have a layout Grid (named "LayoutGrid") in which I have a DataGrid (named "PART_datagrid") with DataGridTemplateColumns. The LayoutGrid is set a DataContext in which there is a Ladders list as a property. This Ladders list is set as the ItemsSource for the PART_datagri...

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 from the GridViewColumnHeader.Click event. Why is the VisualTree null? I need to access...

Force DataGrid into edit mode when using ListView for CellTemplate

Greetings, In an WPF DataGridTemplateColumn I have a CellTemplate using a ListView and a CellEditingTemplate using a DataGrid. <DataTemplate x:Key="LimitsTemplate"> <ListView ItemsSource="{Binding Limits}" IsEnabled="False"> <ListView.ItemTemplate> ... </ListView.ItemTemplate> </ListView> </DataTem...