I need to use the datacontext of my gridview (or window) to bind my column headers. I tried both the gridview and window relativesource and got the same results. My initial view of the grid looks great - any of the columns that are displayed on the initial view have the correct headers. However, if you scroll to the right, any of the columns that weren't originally displayed don't have a header (the datacontext has the correct labels - I've checked). I made the window wider which meant that more column headers display but still not all. Is there some trick to getting all the column headers to bind?
I have attached pictures of the left and right side of the grid.
Here is an example of one of the data columns. Note: The values are displayed correct.
I have attached pictures of the left and right side of the grid.
Here is an example of one of the data columns. Note: The values are displayed correct.
<
telerik:GridViewDataColumn
ColumnGroupName
=
"ColumnsTrans"
DataMemberBinding
=
"{Binding Value1}"
DataFormatString
=
"{}{0:f2}"
IsFilterable
=
"False"
IsReadOnly
=
"True"
Width
=
"70"
FooterTextAlignment
=
"Right"
>
<
telerik:GridViewDataColumn.Header
>
<
TextBlock
TextWrapping
=
"Wrap"
TextAlignment
=
"Center"
>
<
TextBlock.Text
>
<
Binding
RelativeSource
=
"{RelativeSource FindAncestor, AncestorType={x:Type Window}}"
Path
=
"DataContext.Label1"
/>
</
TextBlock.Text
>
</
TextBlock
>
</
telerik:GridViewDataColumn.Header
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
Caption
=
""
ResultFormatString
=
"{}{0:N2}"
></
telerik:SumFunction
>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>