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

Next Expander problem

2 Answers 6 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
Miroslav
Top achievements
Rank 1
Miroslav asked on 25 Mar 2016, 03:27 PM

Hello,

I set this xaml:

<telerikPrimitives:RadExpanderControl Grid.Row="0"
Content="Obecné" IsExpanded="True">
<telerikPrimitives:RadExpanderControl.ExpandableContentTemplate>
          <DataTemplate>
            <StackPanel Orientation="Vertical">
<telerikInput:RadNumericBox x:Name="numListPageSize"
Header="Počet zobrazených nabídek"
AllowNullValue="False"
IsEditable="True"
LargeChange="100"
AcceptsDecimalSeparator="False"
SmallChange="10"
Value="{Binding ListPageSize, Mode=TwoWay}"/>
</StackPanel>
          </DataTemplate>
        </telerikPrimitives:RadExpanderControl.ExpandableContentTemplate>
</telerikPrimitives:RadExpanderControl>

In this case is DataContext in StackPanel in ExpandableContentTemplate nullable. When I change content definition to ContentTemplate as this case:

<telerikPrimitives:RadExpanderControl Grid.Row="0"
IsExpanded="True">
<telerikPrimitives:RadExpanderControl.ContentTemplate>
<DataTemplate>
<TextBlock Text="Obecné"/>
</DataTemplate>
</telerikPrimitives:RadExpanderControl.ContentTemplate>
<telerikPrimitives:RadExpanderControl.ExpandableContentTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<telerikInput:RadNumericBox x:Name="numListPageSize"
Header="Počet zobrazených nabídek"
AllowNullValue="False"
IsEditable="True"
LargeChange="100"
AcceptsDecimalSeparator="False"
SmallChange="10"
Value="{Binding ListPageSize, Mode=TwoWay}"/>
</StackPanel>
</DataTemplate>
</telerikPrimitives:RadExpanderControl.ExpandableContentTemplate>
</telerikPrimitives:RadExpanderControl>

than I can see my binding value in numeric box. I use last internal build.

Best Regards

Miroslav Mareš

2 Answers, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 30 Mar 2016, 02:01 PM
Hi Miroslav,

Thank you for contacting us.

If you set the Content property without setting the ExpandableContent property, the ExpandableContentTemplate will use the Content property as data context. You will have to apply the following change:
<telerikPrimitives:RadExpanderControl Grid.Row="0" Content="Obecné" ExpandableContent="{Binding}" IsExpanded="True">

I hope this helps.

Regards,
Rosy Topchiyska
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Miroslav
Top achievements
Rank 1
answered on 02 Apr 2016, 04:37 PM

Hello,

so there is a dependency between them... ok, I understand, thank you.

Best Regards

Miroslav Mareš

Tags
General Discussion
Asked by
Miroslav
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Miroslav
Top achievements
Rank 1
Share this question
or