Hiding Icons, but show a full width seperator

3 posts, 0 answers
  1. Chris Andrews
    Chris Andrews avatar
    41 posts
    Member since:
    Mar 2010

    Posted 24 Aug 2010 Link to this post

    Hello All,

    We have a RadMenu which we do not need or want icons on.  I successfully set the IconColumnWidth="0" and this hides the icon column just fine.  However, the <telerik:RadMenuItem IsSeparator="True" /> menu item doesn't seem to respect this.  The separator bar is moved over to the right for the width of the icon column used to be.

    Not sure if this is a bug, working as designed, or there is a workaround for this.  Has anyone else run across this behavior?
  2. Dani
    Admin
    Dani avatar
    848 posts

    Posted 25 Aug 2010 Link to this post

    Hello Chris Andrews,

    Thank you for your feedback.

    Indeed, there is such a bug. It is easily fixable. Please, follow the two steps below:

    1. You need the styles for RadMenu. If you are using a custom theme, edit the theme itself. If not, you will need to generate the RadMenu styles from Expression Blend. You can do that by going to Object> Edit Template > Edit a Copy with the RadMenu control selected.

    2. Find the following ControlTemplate:

    <ControlTemplate TargetType="telerikNavigation:RadMenuItem" x:Key="SeparatorTemplate">
               <Grid Height="2" Margin="{StaticResource MenuItemSeparatorMargin}">
                   <Rectangle Height="1" VerticalAlignment="Top"
                       Fill="{StaticResource MenuItemSeparatorTop}" />
                   <Rectangle Height="1" VerticalAlignment="Bottom"
                       Fill="{StaticResource MenuItemSeparatorBottom}" />
               </Grid>
           </ControlTemplate>

    And replace it with this:

    <ControlTemplate TargetType="telerikNavigation:RadMenuItem" x:Key="SeparatorTemplate">
                <Grid Margin="2">
                    <Grid Height="2" Margin="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Menu.IconColumnWidth}">
                        <Rectangle Height="1" VerticalAlignment="Top"
                            Fill="{StaticResource MenuItemSeparatorTop}" />
                        <Rectangle Height="1" VerticalAlignment="Bottom"
                            Fill="{StaticResource MenuItemSeparatorBottom}" />
                    </Grid>
                </Grid>            
            </ControlTemplate>

    Again, thank you for reporting this. Since your feedback is precious to us, I have updated your Telerik points accordingly.

    Please, feel free to contact us again in case you need further help.

    Sincerely yours,
    Dani
    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Dani
    Admin
    Dani avatar
    848 posts

    Posted 25 Aug 2010 Link to this post

    Hello Chris Andrews,

    In addition to my previous post, I would like to let you know that this bug will be fixed in the next Latest Internal Build. Once this is done, you can also remove the fix I suggested, since it will not be needed anymore.


    Greetings,
    Dani
    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
Back to Top