This is a migrated thread and some comments may be shown as answers.

RadExpander - HeaderTemplate Issue

1 Answer 140 Views
Expander
This is a migrated thread and some comments may be shown as answers.
Stefan Buys
Top achievements
Rank 2
Stefan Buys asked on 23 Aug 2011, 09:01 AM
Hi

I have a RadExpander (2011 Q2) with a custom HeaderTemplate.

See below:

<telerik:RadExpander>
    <telerik:RadExpander.HeaderTemplate>
        <DataTemplate>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="0.5*"/>
                    <ColumnDefinition Width="0.5*" />
                </Grid.ColumnDefinitions>
                <dataInput:Label Content="{Binding Path=QueryDetails, Mode=TwoWay}" Grid.Column="0" FontWeight="Bold" Margin="0,0,10,0" Height="Auto" />
                <dataInput:Label Content="Queries" Grid.Column="1" FontWeight="Bold" HorizontalAlignment="Right"  Margin="0,0,10,0" Height="Auto" />
            </Grid>
        </DataTemplate>
    </telerik:RadExpander.HeaderTemplate>
...
</telerik:RadExpander>

I am binding the first label to a String in my ViewModel, but the UI never seems to display the value via the binding. I have tried binding the property to a label somewhere else on the page (outside the template) and it works fine.

Any advise will be welcome.

Stefan

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 26 Aug 2011, 07:50 AM
Hello Stefan,

The HeaderTemplate of the RadExpander will be only applied if the Header property is bound to a data object. Only then the control will look for a HeaderTemplate to set the visual representation of the business object bound to the header.

From the code snippet you sent I don't see if the RadExpander.Header property is databound. If it's not binding it should fix the issue. If, however, this is not the case, then please send us a sample project illustrating your scenario so that we can further investigate the issue. Thank you in advance.

Regards,
Tina Stancheva
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Expander
Asked by
Stefan Buys
Top achievements
Rank 2
Answers by
Tina Stancheva
Telerik team
Share this question
or