Icon size issue

8 posts, 1 answers
  1. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 03 Dec 2008 Link to this post

    I just found a minor problem with displaying icons in the menu. When the width of the icons exceed that of the left column in the menu, the column doesn't resize accordingly. While I realise that this can probably be fixed by creating a custom template, it would be convenient if the resizing was included in the default template. I've uploaded a screenshot here:

    http://cid-cc43a90a79374ebd.skydrive.live.com/self.aspx/Public/RadMenu|_IconSize.png

  2. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 03 Dec 2008 Link to this post

    Hello Henrik,

    The Icon property is of type object. This allows you to put not only Image control but also Path.
    Even if it was of type Image dynamically resizing the column width would not be possible because image dimensions are not known until the image is shown and you cannot bind to ActualWidth property (Silverlight limitation).

    So my recommendation is to set Image with Width=20.

    Best wishes,
    Hristo
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 03 Dec 2008 Link to this post

    Ok, maybe you could at least include the possibility of setting the width of the icon column manually? At some point I'm going to want to let the user switch between different icon sizes in my app, mainly for accessibility reasons, and that's not possible at the moment.
  5. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 04 Dec 2008 Link to this post

    Hi Henrik,

    The column with the Icon is with Width="Auto". But like I said the problem is that Image control do not report its size until it is shown. So right now setting the image size manually is the best option. This way the column will resize.

    Exposing property for the column that holds the Icon couples the control with the template too much. If someone modify the control template and forget to bind it, this property become useless.

    I hope that the next version of Silverlight won't have this limitations regarding Image control.


    Regards,
    Hristo
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 04 Dec 2008 Link to this post

    Yeah, I understand the problem with images, but even when I set the Icon object to a Grid or whatever and set the width on that, the column doesn't resize properly. An example:

    <UserControl x:Class="SilverlightApplication4.Page5" 
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                 xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" 
                 xmlns:teleriknav="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
                 xmlns:telerikbase="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
                 Width="400" 
                 Height="300"
        <Grid x:Name="LayoutRoot" 
              Background="White"
            <teleriknav:RadMenu> 
                <teleriknav:RadMenu.Items> 
                    <teleriknav:RadMenuItem Header="Item 1"
                        <teleriknav:RadMenuItem.Items> 
                            <teleriknav:RadMenuItem Header="Item 1 - 1"
                                <teleriknav:RadMenuItem.Icon> 
                                    <Grid Width="60" 
                                          Height="60"
                                        <Border VerticalAlignment="Center" 
                                                HorizontalAlignment="Center" 
                                                BorderBrush="Red" 
                                                Width="30" 
                                                Height="30" 
                                                BorderThickness="2"></Border> 
                                    </Grid> 
                                </teleriknav:RadMenuItem.Icon> 
                            </teleriknav:RadMenuItem> 
                            <teleriknav:RadMenuItem Header="Item 1 - 2"
                                <teleriknav:RadMenuItem.Icon> 
                                    <Grid Width="60" 
                                          Height="60"
                                        <Border VerticalAlignment="Center" 
                                                HorizontalAlignment="Center" 
                                                BorderBrush="Red" 
                                                Width="30" 
                                                Height="30" 
                                                BorderThickness="2"></Border> 
                                    </Grid> 
                                </teleriknav:RadMenuItem.Icon> 
                            </teleriknav:RadMenuItem> 
                        </teleriknav:RadMenuItem.Items> 
                    </teleriknav:RadMenuItem> 
                </teleriknav:RadMenu.Items> 
            </teleriknav:RadMenu> 
        </Grid> 
    </UserControl> 
     

  7. Answer
    Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 04 Dec 2008 Link to this post

    Hi Henrik,

    I've modified SubMenuItem control template to show the gridlines and found that actually grid column width is the same as the Icon width. The problem is with the vertical line. This line is in the background of the popup and is not connected with column grid width but is should be. This can be fixed by editing the MenuItem control template. We will definitely fix it for the Q1 release.

    Thanks again for your valuable feedback.


    Greetings,
    Hristo
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. max
    max avatar
    9 posts
    Member since:
    Sep 2007

    Posted 06 May 2009 Link to this post

    You said "We will definitely fix it for the Q1 release" but I just spent half a day upgrading to that release and it still doesn't work.  Am I missing something or has this promise been broken?
  9. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 08 May 2009 Link to this post

    Hello max,

    I'm sorry that I have to disappoint you but I have to admit that this was not so easy to implement so we decided the postpone this feature. I will try to find a work-around and I will let you know as soon as I have a working solution.

    Thanks for your patience with us. We deeply apologize for the caused inconvenience.

    Sincerely yours,
    Hristo
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top
DevCraft banner