Next Expander problem

3 posts, 0 answers
  1. Miroslav
    Miroslav avatar
    30 posts
    Member since:
    Feb 2012

    Posted 25 Mar Link to this post

    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. Rosy Topchiyska
    Admin
    Rosy Topchiyska avatar
    551 posts

    Posted 30 Mar Link to this post

    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
  3. DevCraft banner
  4. Miroslav
    Miroslav avatar
    30 posts
    Member since:
    Feb 2012

    Posted 02 Apr in reply to Rosy Topchiyska Link to this post

    Hello,

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

    Best Regards

    Miroslav Mareš

Back to Top