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

Icon size issue

7 Answers 160 Views
Menu
This is a migrated thread and some comments may be shown as answers.
hwsoderlund
Top achievements
Rank 1
hwsoderlund asked on 03 Dec 2008, 08:18 AM
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

7 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 03 Dec 2008, 08:44 AM
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.
0
hwsoderlund
Top achievements
Rank 1
answered on 03 Dec 2008, 12:19 PM
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.
0
Hristo
Telerik team
answered on 04 Dec 2008, 08:46 AM
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.
0
hwsoderlund
Top achievements
Rank 1
answered on 04 Dec 2008, 10:37 AM
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> 
 

0
Accepted
Hristo
Telerik team
answered on 04 Dec 2008, 11:53 AM
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.
0
max
Top achievements
Rank 1
answered on 06 May 2009, 05:16 AM
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?
0
Hristo
Telerik team
answered on 08 May 2009, 05:07 PM
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.
Tags
Menu
Asked by
hwsoderlund
Top achievements
Rank 1
Answers by
Hristo
Telerik team
hwsoderlund
Top achievements
Rank 1
max
Top achievements
Rank 1
Share this question
or