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

[Solved] Image not included in the button

3 Answers 67 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mayra
Top achievements
Rank 1
Mayra asked on 22 Oct 2011, 03:14 PM
Can someone please help me to understand why the image is not applied to the button?

<DataTemplate x:Key="PaneButtonsTitleTemplate">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <ContentPresenter Content="{Binding}"
                          Margin="0,0,75,0" />
                <StackPanel Grid.Column="1"
                            HorizontalAlignment="Right"
                            Orientation="Horizontal" >
                    <telerik:RadButton Background="{StaticResource FillColor}"
                                       Foreground="{StaticResource TextColor}"                                      
                                       Command="telerik:RadDockingCommands.Floating"
                                       Width="50"
                                       Height="20"
                                       ToolTipService.ToolTip="Pop-out" >
                        <StackPanel Orientation="Horizontal" >
                            <TextBlock Foreground="{StaticResource TextColor}">
                                Pop-out
                            </TextBlock>
                            <Image Source="Icons/popout.png" Height="15"/>
                        </StackPanel>
                    </telerik:RadButton>
                    <telerik:RadButton Width="20" Height="50">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Margin="11">Button</TextBlock>
                            <Image Source="Icons/strawberry.png" Height="20"></Image>
                        </StackPanel>
                    </telerik:RadButton>
                </StackPanel>             
            </Grid>
        </DataTemplate>

3 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 26 Oct 2011, 03:14 PM
Hello Mayra,

 We managed to reproduce this issue. It appears that the width of the first RadButton (50) is not enough and there is no space left for the Image on the right of the "Pop-out" TextBlock. Changing the width to 70-80 solved this. Please let us know if this helps you.

Greetings,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Mayra
Top achievements
Rank 1
answered on 26 Oct 2011, 08:33 PM
Thanks a lot for the reply.
Here are some of the things I have also change and still have not been able to see the picture:
- I have set the with and height to 100 
- I have change and use other picture
- I have removed the text

I an not sure what can be causing the issue. I look forward to hear from you.

Regards,

Mayra 

0
Zarko
Telerik team
answered on 31 Oct 2011, 04:27 PM
Hello Mayra,
I've created a sample project using your code snippets and when I changed the width of the buttons to 100px everything seemed to work fine - the images are visible. Could you please examine the attached project and see if it helps you to fix your problem and also you may want to check if your image paths are correct.
If you have more questions feel free to ask.

Kind regards,
Zarko
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Buttons
Asked by
Mayra
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Mayra
Top achievements
Rank 1
Zarko
Telerik team
Share this question
or