I have the following DataGrid defined in my XAML:
<xcdg:DataGridControl>
<xcdg:DataGridControl.Columns>
<xcdg:Column FieldName="ContactName" />
</xcdg:DataGridControl.Columns>
<xcdg:DataGridControl.View>
<xcdg:CompactCardView>
<xcdg:CompactCardView.CardTitleTemplate>
<DataTemplate>
<TextBlock Text="{Binding [ContactName]}" />
</DataTemplate>
</xcdg:CompactCardView.CardTitleTemplate>
</xcdg:CompactCardView>
</xcdg:DataGridControl.View>
</xcdg:DataGridControl>
At run-time, I expect the value in the ContactName field of each record to also appear in the card title, but I am getting the following error showing in my Output window:
System.Windows.Data Error: 39 : BindingExpression path error: '[]' property not found on 'object' ''ContactDetails' (HashCode=55223077)'. BindingExpression:Path=[ContactName]; DataItem='ContactDetails' (HashCode=55223077); target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')
What am I doing wrong here?
Thanks for any help,
Jason
Associate, .NET Development
Morgan Stanley, UK