This question is locked. New answers and comments are not allowed.
I'm trying to use an AlignmentContentPresenter to wrap the header text on a GridView. Works fine until I try and reset the ItemSource for the grid, at which point the app throws a xaml error at line 0 position 0.
Got a very small app to demonstrate. Hopefully something I'm just not doing right in the XAML, but looks like a bug to me.
Thanks
Tom
XAML:
C#:
Got a very small app to demonstrate. Hopefully something I'm just not doing right in the XAML, but looks like a bug to me.
Thanks
Tom
XAML:
| <UserControl xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| xmlns:Telerik_Windows_Controls_GridView="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView" |
| mc:Ignorable="d" x:Class="SilverlightApplication1.MainPage" |
| d:DesignWidth="640" d:DesignHeight="480"> |
| <Grid x:Name="LayoutRoot"> |
| <telerikGridView:RadGridView Name="dg1" Height="110" VerticalAlignment="Top" AutoGenerateColumns="False"> |
| <telerikGridView:RadGridView.Columns> |
| <telerikGridView:GridViewDataColumn UniqueName="val" > |
| <telerikGridView:GridViewDataColumn.Header > |
| <Telerik_Windows_Controls_GridView:AlignmentContentPresenter TextWrapping="Wrap" Content="Jan 4/4/4" /> |
| </telerikGridView:GridViewDataColumn.Header> |
| </telerikGridView:GridViewDataColumn> |
| </telerikGridView:RadGridView.Columns> |
| </telerikGridView:RadGridView> |
| <Button Name="Button1" HorizontalAlignment="Left" VerticalAlignment="Top" Width="85" Content="Reset Source" Margin="0,120,0,0"/> |
| </Grid> |
| </UserControl> |
| using System; |
| using System.Collections.Generic; |
| using System.Linq; |
| using System.Net; |
| using System.Windows; |
| using System.Windows.Controls; |
| using System.Windows.Documents; |
| using System.Windows.Input; |
| using System.Windows.Media; |
| using System.Windows.Media.Animation; |
| using System.Windows.Shapes; |
| using System.Collections.ObjectModel; |
| namespace SilverlightApplication1 |
| { |
| public partial class MainPage : UserControl |
| { |
| public ObservableCollection<DataRow> myData; |
| public MainPage() |
| { |
| InitializeComponent(); |
| myData = new ObservableCollection<DataRow>(); |
| myData.Add(new DataRow(1)); |
| myData.Add(new DataRow(2)); |
| dg1.ItemsSource = myData; |
| this.Button1.Click += new RoutedEventHandler(Button1_Click); |
| } |
| void Button1_Click(object sender, RoutedEventArgs e) |
| { |
| myData = new ObservableCollection<DataRow>(); |
| myData.Add(new DataRow(1)); |
| myData.Add(new DataRow(2)); |
| dg1.ItemsSource = myData; |
| } |
| } |
| public class DataRow |
| { |
| public DataRow(int newVal) |
| { |
| val = newVal; |
| } |
| public int val |
| { |
| set; |
| get; |
| } |
| } |
| } |