Binding GridViewColumnGroup in TreListView

2 posts, 0 answers
  1. Pablo
    Pablo avatar
    8 posts
    Member since:
    Feb 2016

    Posted 18 Nov 2016 Link to this post

    Dear,

    Binding 'Header' property to DataContext in a GridVewColumnGroup doesn't work. Public property is not requested to DataContext.

        <telerik:GridViewColumnGroup Name="RangeColumn" Header="{Binding FirstDependencyName, FallbackValue=Nothing}" />

    By other hand, a binding to StaticResource works property.

        <telerik:GridViewColumnGroup Name="RangeColumn" Header="{Binding Source={StaticResource appResx}, Path=btn_Create}" />

    In next example, public property is requested to DataContext (value is received tested with a converter), but surprisingly it is not displayed.

        <telerik:GridViewColumnGroup Name="RangeColumn">
            <telerik:GridViewColumnGroup.Header>
                <TextBlock Text="{Binding FirstDependencyName, FallbackValue=Nothing}"/>
            </telerik:GridViewColumnGroup.Header>
        </telerik:GridViewColumnGroup>

    Do you have any suggestion?
    Thank you
  2. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    603 posts

    Posted 21 Nov 2016 Link to this post

    Hello Pablo,

    In order to successfully bind the Header property to a property of your view model, you will need to specify the Source for this binding. I'm attaching a sample project with the implementation.

    Please let me know if this works for you.

    Regards,
    Dilyan Traykov
    Telerik by Progress
    Telerik UI for WPF is ready for Visual Studio 2017 RC! Learn more.
Back to Top