Menu item and empty space

3 posts, 0 answers
  1. Paolo
    Paolo avatar
    423 posts
    Member since:
    Jun 2009

    Posted 10 Feb 2012 Link to this post

    Hello Telerik,
    I got a small annoyance wit the telerik radmenu, I've defined my own hyierachicaldatatemplate as

    <HierarchicalDataTemplate x:Key="MenuItemTemplate" ItemsSource="{Binding Items}">
              <TextBlock Text="{Binding Text}" cal:Message.Attach="[Event PreviewMouseDown] = [Action OpenView($dataContext)]"  cal:Action.TargetWithoutContext="{Binding}" />
          </HierarchicalDataTemplate>

    (I use caliburn micro for mvvm pattern)

    and I b've defined the radmenu as

    <telerik:RadMenu x:Name="MenuList"  ClickToOpen="False"   BorderBrush="Transparent" ItemsSource="{Binding Items}" ItemTemplate="{StaticResource MenuItemTemplate}">
               <telerik:RadMenu.ItemContainerStyle>
                  <Style TargetType="telerik:RadMenuItem">
                       
                       <Setter Property="Visibility" Value="{Binding IsVisible,Converter={StaticResource booleanConverter}}"></Setter>
                   </Style>
               </telerik:RadMenu.ItemContainerStyle>
               <!--ItemsSource="{Binding Items}" ItemTemplate="{StaticResource MenuItemTemplate}"-->
           </telerik:RadMenu>

    The problem I got now is that if I've (as text)

    MenuToplevelItem
    Voice1    (*)
    VoiceLongerThenVoice1

    I've to click exacly on Voice 1, if I click where I put (*) it won't call the OpenView() ...same meaning if I click on the left part of the menuitem... it does't work.. how can I style the menuitem in order to a stackpanel/text larger as the largest value?
    Thanks
  2. Paolo
    Paolo avatar
    423 posts
    Member since:
    Jun 2009

    Posted 13 Feb 2012 Link to this post

    anyone on this?
  3. UI for WPF is Visual Studio 2017 Ready
  4. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 16 Feb 2012 Link to this post

    Hi Paolo,

    I am sorry, but I am not sure what might the problem be, the DataTemplate seems to be correct. Could you please prepare a quick sample in which this can be observed. In that way we will be able to run it here locally and track down the source of the problem.

    Looking forward to your reply.

    Greetings,
    Konstantina
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top