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

Expander content doesn't stretch with 2011 Q1

14 Answers 232 Views
Expander
This is a migrated thread and some comments may be shown as answers.
Schokoolero50
Top achievements
Rank 1
Schokoolero50 asked on 16 Mar 2011, 04:43 PM

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

14 Answers, 1 is accepted

Sort by
0
Carlos
Top achievements
Rank 1
answered on 17 Mar 2011, 06:21 PM
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

 

 

 

 

 

0
Hristo
Telerik team
answered on 17 Mar 2011, 07:51 PM
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
0
Schokoolero50
Top achievements
Rank 1
answered on 18 Mar 2011, 09:00 AM

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.

0
Accepted
Hristo
Telerik team
answered on 18 Mar 2011, 11:31 AM
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
0
Schokoolero50
Top achievements
Rank 1
answered on 18 Mar 2011, 11:58 AM

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

0
Chris
Top achievements
Rank 1
answered on 22 Mar 2011, 07:33 AM

 

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.

0
Tina Stancheva
Telerik team
answered on 22 Mar 2011, 11:00 AM
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
0
Chris
Top achievements
Rank 1
answered on 22 Mar 2011, 11:02 AM
Hi Tina,

That will be perfect.

Thanks!
0
Murray
Top achievements
Rank 2
answered on 19 Apr 2011, 04:04 PM
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?
0
Petar Mladenov
Telerik team
answered on 19 Apr 2011, 04:24 PM
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
0
Mark
Top achievements
Rank 1
answered on 29 Jun 2011, 06:59 PM
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.
0
Tina Stancheva
Telerik team
answered on 30 Jun 2011, 04:40 PM
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
0
Mark
Top achievements
Rank 1
answered on 30 Jun 2011, 10:29 PM
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.
0
Mark
Top achievements
Rank 1
answered on 01 Jul 2011, 07:34 PM
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.
Tags
Expander
Asked by
Schokoolero50
Top achievements
Rank 1
Answers by
Carlos
Top achievements
Rank 1
Hristo
Telerik team
Schokoolero50
Top achievements
Rank 1
Chris
Top achievements
Rank 1
Tina Stancheva
Telerik team
Murray
Top achievements
Rank 2
Petar Mladenov
Telerik team
Mark
Top achievements
Rank 1
Share this question
or