Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Expander > Expander content doesn't stretch with 2011 Q1

Answered Expander content doesn't stretch with 2011 Q1

Feed from this thread
  • Schokoolero50 avatar

    Posted on Mar 16, 2011 (permalink)

    Hello

    I have just downloaded and installed RadControls_for_WPF35_2011_1_0315_Trial. Before I was evaluating  RadControls_for_WPF35_2010_3_1314_Trial and had just constructed a nice window using several RadExpanders.

    With the old controls the content stretched to the width of the window, now it doesn't even stretch when I add HorizontalAlignment="Stretch".

    I have reduced my code to create a minimalistic example.

    The RadMaskedTextBoxes did stretch to the width of the window with 2010 Q3, but they don't do that anymore with 2011 Q1.

    <Window x:Class="WPFApplication1.MainWindow"
            Title="Window1">
            <StackPanel>
                <telerik:RadExpander Header="Head1" VerticalAlignment="Top" IsExpanded="true">
                    <Grid VerticalAlignment="Bottom" HorizontalAlignment="Stretch">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="0.5*" />
                            <ColumnDefinition Width="0.5*" />
                        </Grid.ColumnDefinitions>
                        <telerik:RadMaskedTextBox Grid.Column="0" MaskType="None" MaskedText="Text1"/>
                        <telerik:RadMaskedTextBox Grid.Column="1" MaskType="None" MaskedText="Text2"/>
                    </Grid>
                </telerik:RadExpander>
                <telerik:RadExpander Header="Head2" VerticalAlignment="Top" IsExpanded="true">
                    <Grid VerticalAlignment="Bottom">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="0.5*" />
                            <ColumnDefinition Width="0.5*" />
                        </Grid.ColumnDefinitions>
                        <Label Grid.Column="0" Content="LongLabel1" HorizontalAlignment="Center"/>
                        <Label Grid.Column="1" Content="LongLabel2" HorizontalAlignment="Center"/>
                    </Grid>
                </telerik:RadExpander>
            </StackPanel>
    </Window>

    Please tell me how to enable the stretching of the content again. Without that the control is pretty useless to me and I wasted a day on a prototype.

    Thank you

    Reply

  • Carlos avatar

    Posted on Mar 17, 2011 (permalink)

    You can apply a workaround to the content, in your case to the grid inside radExpander

    Width

     

     

    ="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=telerik:RadExpander, AncestorLevel=1}, Path=ActualWidth

     

    }"
    or

     

     

    Height="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=telerik:RadExpander, AncestorLevel=1}, Path=ActualHeight

    }"

    Danilo Afonseca

     

     

     

     

     

    Reply

  • Hristo Hristo admin's avatar

    Posted on Mar 17, 2011 (permalink)

    Hi All,

    Unfortunately we revealed new bug in the expander within our last official release and we are very sorry for the inconvenience. I already answered similar issue on the forums under following link: http://www.telerik.com/community/forums/silverlight/expander/expander-problem-in-radcontrols-for-silverlight-q1-2011.aspx .

    However, the workaround is simple and easy to apply. You need to change the content template of RadExpander with one provided in the attached file. This should do the work and solve you case.

    Please let me know if you need more info or if the provided solution does not solve your issue.

    Regards,
    Hristo
    the Telerik team
    Attached files

    Reply

  • Schokoolero50 avatar

    Posted on Mar 18, 2011 (permalink)

    Hi Hristo,

    I haven't really worked that much with styles and templates. What am I supposed to do with the Style you attached?

    I tried putting it in the resources of the application and nothing changed and I placed it in the windows resource with the same result.

    Reply

  • Answer Hristo Hristo admin's avatar

    Posted on Mar 18, 2011 (permalink)

    Hi Carlos ,

    As you probably know WPF controls are designed in a way that you can change their look entirely while preserving their functionality - this said that WPF controls are "lookless". There are basically two ways to change the look of the control: changing its Style; changing its Template. For more info about changing style and template of our controls you could take a look at the following link: http://www.telerik.com/help/silverlight/common-styling-appearance-edit-control-templates-blend.html.

    I've attached a sample project with the DLLs from the Q1 2011 official release. In the project you can see how I'm changing the Template property of the expander:

    <telerik:RadExpander x:Name="theExpander"
        Template="{StaticResource RadExpanderControltemplateWPF_FIX}"...>
    ....

    You can take a look at the project and see what happens with the expander when you apply the updated style or template (RadExpanderStyleWPF_FIX or RadExpanderControltemplateWPF_FIX). If you remove the style and the template setters you should observe the buggy behaviour.

    Hope this helps.


    Greetings,
    Hristo
    the Telerik team

    Reply

  • Schokoolero50 avatar

    Posted on Mar 18, 2011 (permalink)

    Hi Hristo,

    I didn't find the time to study Blend yet, although I get the feeling I probably won't get around it.

    Although my name isn't Carlos (Carlos is the guy who offered a different solution) the second template actually solves my problem. The first template you attached did absolutely nothing, even after I set the template property of the expander. The template in your example application completely ruins the look in the designer but does what I wanted in the running program.

    Thanks

    Schokoolero50

    Reply

  • Chris avatar

    Posted on Mar 22, 2011 (permalink)

     

    Hi,

    Please can you advise when the next internal build will be that rectifies this bug? We use the Expander control extensively in our various applications and I cannot go and change the style for each one.

    Reply

  • Tina Stancheva Tina Stancheva admin's avatar

    Posted on Mar 22, 2011 (permalink)

    Hi Chris,

    The internal build should be available later today. I hope this time frame is acceptable for you.

    Regards,
    Tina Stancheva
    the Telerik team

    Reply

  • Chris avatar

    Posted on Mar 22, 2011 (permalink)

    Hi Tina,

    That will be perfect.

    Thanks!

    Reply

  • Posted on Apr 19, 2011 (permalink)

    The release notes for the latest internal build doesnt seem to address this issue? Was it fixed in the current internal build or do we need to use the workaround?

    Reply

  • Petar Mladenov Petar Mladenov admin's avatar

    Posted on Apr 19, 2011 (permalink)

    Hello Murray,

    This issue was fixed in the internal build in the week 21-25 March 2011. So this was mentioned only in the release notes for this build, but not for the following internal builds.  So you don't need to use a workaround if you use an internal build after the 20 March. The fix will be also included in the official 2011 Q1 SP1 that will be available later this week.

    Greetings,
    Petar Mladenov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items

    Reply

  • Mark avatar

    Posted on Jun 29, 2011 (permalink)

    Hello Hristo,

    I am having a similar resizing issue with the RadExpander that does not seem to be addressed in this workaround.  I am hoping you can perhaps point me in the right direction as well.

    In my usage I have a custom header.  My header is composed of a grid with two columns, the left column is lef-aligned, while the right is right-aligned.  With the new version of the control I have noticed that the header does not stretch to the width of the control.  Setting the HorizontalAlignment=Stretch, with the given style workaround does not seem to help.

    Do you know whether this change in header sizing/alignment will be fixed as well?  Do you have any suggestions for a workaround?

    Thanks,
    Mark.

    Reply

  • Tina Stancheva Tina Stancheva admin's avatar

    Posted on Jun 30, 2011 (permalink)

    Hello Mark,

    The given workaround is only applicable for the Q1 2011 release. What is the version of the RadControls you use? Can you try your solution with the latest release and let us know if it works because we are not aware of any alignment issues in the latest version of the control.

    Thank you in advance for your cooperation.

    All the best,
    Tina Stancheva
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items

    Reply

  • Mark avatar

    Posted on Jun 30, 2011 (permalink)

    Hi Tina,

    I have tried the workaround on The Q1 release as well as the latest internal builds.  I can see how the workaround makes the content of the RadExpander stretch properly, but it appears to have no effect on the Header content, and I cannot seem to come up with a workaround on my own.

    To see the problem, you can modify the sample that was attached to this case, and modify the RadExpander header in a way similar to the following:

    <Controls1:RadExpander
        DockPanel.Dock="Top"
        MaxHeight="260"
        Animation:AnimationManager.IsAnimationEnabled="False"
        HorizontalAlignment="Stretch">
      
    <Controls1:RadExpander.Header>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
      
            <TextBlock
                Grid.Column="0"
                Text="Filter"
                VerticalAlignment="Center"/>
      
            <TextBlock
                Grid.Column="1"
                VerticalAlignment="Center"
                HorizontalAlignment="Right"
                Text="This is a test"
                TextTrimming="CharacterEllipsis"/>
        </Grid>
    </Controls1:RadExpander.Header>
      
    <Controls2:RadDataFilter
        x:Name="m_radDataFilter"
        />
      
    </Controls1:RadExpander>

    In the Q3 release, this xaml would render the text "This is a test" right-justified using the complete width of the control.  This no longer happens.  As a result, the header text gets rendered as "FilterThis is a test". 

    Using Snoop, it appears that the toggle button control used in the header does not stretch to the width of the control as it used to.  However, I was unsuccessful in modifying the template to make this happen.

    I hope this provides more information and allows you to reproduce the issue.  I would be happy to provide any more information that you may require.

    Thanks,
    Mark.

    Reply

  • Mark avatar

    Posted on Jul 1, 2011 (permalink)

    Hi Tina,

    Actually, it appears that this issue is fixed in the Q1 SP1 release of the controls.  (I thought I had tested it, but our build system was  silently copying over a different set of assemblies.)

    Sorry for the confusion and thanks for your help!
    Mark.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Expander > Expander content doesn't stretch with 2011 Q1
Related resources for "Expander content doesn't stretch with 2011 Q1"

WPF Expander Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]