Image not included in the button

4 posts, 0 answers
  1. Mayra
    Mayra avatar
    18 posts
    Member since:
    Oct 2011

    Posted 22 Oct 2011 Link to this post

    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>

  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 26 Oct 2011 Link to this post

    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 >>

  3. DevCraft banner
  4. Mayra
    Mayra avatar
    18 posts
    Member since:
    Oct 2011

    Posted 26 Oct 2011 Link to this post

    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 

  5. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 31 Oct 2011 Link to this post

    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 >>

Back to Top