Expander content doesn't stretch with 2011 Q1

15 posts, 1 answers
  1. Schokoolero50
    Schokoolero50 avatar
    11 posts
    Member since:
    Mar 2011

    Posted 16 Mar 2011 Link to this post

    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

  2. Carlos
    Carlos  avatar
    1 posts
    Member since:
    Aug 2010

    Posted 17 Mar 2011 Link to this post

    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

     

     

     

     

     

  3. UI for WPF is Visual Studio 2017 Ready
  4. Hristo
    Admin
    Hristo avatar
    352 posts

    Posted 17 Mar 2011 Link to this post

    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
  5. Schokoolero50
    Schokoolero50 avatar
    11 posts
    Member since:
    Mar 2011

    Posted 18 Mar 2011 Link to this post

    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.

  6. Answer
    Hristo
    Admin
    Hristo avatar
    352 posts

    Posted 18 Mar 2011 Link to this post

    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
  7. Schokoolero50
    Schokoolero50 avatar
    11 posts
    Member since:
    Mar 2011

    Posted 18 Mar 2011 Link to this post

    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

  8. Chris
    Chris avatar
    10 posts
    Member since:
    Dec 2009

    Posted 22 Mar 2011 Link to this post

     

    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.

  9. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 22 Mar 2011 Link to this post

    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
  10. Chris
    Chris avatar
    10 posts
    Member since:
    Dec 2009

    Posted 22 Mar 2011 Link to this post

    Hi Tina,

    That will be perfect.

    Thanks!
  11. Murray
    Murray avatar
    121 posts
    Member since:
    Aug 2010

    Posted 19 Apr 2011 Link to this post

    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?
  12. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 19 Apr 2011 Link to this post

    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
  13. Mark
    Mark avatar
    44 posts
    Member since:
    Jun 2009

    Posted 29 Jun 2011 Link to this post

    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.
  14. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 30 Jun 2011 Link to this post

    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
  15. Mark
    Mark avatar
    44 posts
    Member since:
    Jun 2009

    Posted 30 Jun 2011 Link to this post

    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.
  16. Mark
    Mark avatar
    44 posts
    Member since:
    Jun 2009

    Posted 01 Jul 2011 Link to this post

    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.
Back to Top
UI for WPF is Visual Studio 2017 Ready