I'm having an issue with column header wrapping due to my headers being bound to the DisplayName attribute of my properties.
I have a Property in my view model, using the DisplayName attribute:
[DisplayName("Component Item Identifier")] public String ComponentItem { get { return componentItem; } set { ... } } I can make that display in the header using:
<telerikGrid:GridViewDataColumn UniqueName="ComponentItem" DataMemberBinding="{Binding Path=ComponentItem}" Header="{Binding Path=ComponentItem.DisplayName}" > </telerikGrid:GridViewDataColumn>However, I need to make the header column wrap the text. The method I've found in these forums is via using a TextBlock as the header UI element, and I can make that work without the bindings:
<telerikGrid:GridViewDataColumn UniqueName="ComponentItem"DataMemberBinding="{Binding Path=ComponentItem}"> <telerikGrid:GridViewDataColumn.Header> <Grid> <TextBlock Text="MY LONG TEXT FOR TESTING WRAPPING" TextWrapping="Wrap"/> </Grid> </telerikGrid:GridViewDataColumn.Header> </telerikGrid:GridViewDataColumn>But, the problem comes when I try to bind that TextBlock to my DisplayName, as follows, the header ends up blank:
<telerikGrid:GridViewDataColumn UniqueName="ComponentItem"DataMemberBinding="{Binding Path=ComponentItem}"> <telerikGrid:GridViewDataColumn.Header> <Grid> <TextBlock Text="{Binding Path=ComponentItem.DisplayName}" TextWrapping="Wrap"/> </Grid> </telerikGrid:GridViewDataColumn.Header> </telerikGrid:GridViewDataColumn>Am I binding incorrectly in this code? Or is this just not supported in this structure?
Sincerely,
Russell.