problem related to context menu

11 posts, 0 answers
  1. Hardik
    Hardik avatar
    61 posts
    Member since:
    Jun 2011

    Posted 03 Sep 2011 Link to this post

    hi telerik,

    I have implemented a context menu in my project, its working but with some limitation and bugs.

    When my view loaded at that time, on first right click in schedulerView context menu is not opened. After that it will open the context menu and on every next click its working fine. Just problem with first time load. This is the very big problem for me.

    As I had test it more I found that when I go from one Viewmode(Day,week,month) to another at that time same problem arise.


    One thing which is something problematic for me. When I right click on appointment at that time new appointment is also enabled. I think it should be disabled.(See Image-1).

    In my application I done following thing in XAML

     <telerik:RadContextMenu.ContextMenu>
                <telerik:RadContextMenu  IsOpen="{Binding IsContextMenuOpen, Mode=TwoWay}" >
                    <telerik:RadMenuItem Header="New Reservation..." CommandTarget="{Binding Menu.UIElement, RelativeSource={RelativeSource Self}}"
                                Command="schedule:RadScheduleViewCommands.CreateAppointment" Icon="{Binding Text, Converter={StaticResource XamlImageSourceConverter}, ElementName=XamlRecurrence}" />                
                    <TextBlock x:Name="XamlRecurrence"
                                   Text="Recurrence"
                                   Width="1000"
                                   Visibility="Collapsed" />
                    <telerik:RadMenuItem Header="Open reservation..." CommandTarget="{Binding Menu.UIElement, RelativeSource={RelativeSource Self}}"
                                Command="schedule:RadScheduleViewCommands.EditAppointment" />             
                </telerik:RadContextMenu>
            </telerik:RadContextMenu.ContextMenu>

  2. Pana
    Admin
    Pana avatar
    748 posts

    Posted 03 Sep 2011 Link to this post

    Hello,

    You could use the GetClickedElements<> method of the RadContextMenu to get the items under the mouse at the time of the click. Then you could set the visibility of the RadMenuItems exposed. Check the attached project for more details.

    I am sorry for the project name RadDatePickerDisabled. The controls demo inside is for RadScheduleView anyway.

    Kind regards,
    Pana
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. DevCraft banner
  4. Hardik
    Hardik avatar
    61 posts
    Member since:
    Jun 2011

    Posted 08 Sep 2011 Link to this post

    Hi telerik,

    What about this?

    When my view loaded at that time, on first right click in schedulerView context menu is not opened. After that it will open the context menu and on every next click its working fine. Just problem with first time load. This is the very big problem for me.

    As I had test it more I found that when I go from one Viewmode(Day,week,month) to another at that time same problem arise.


    When I right click on appointment at that time new appointment is also enabled. I think it should be disabled.(See Image-1).

    I just want to make the New tab disable when I right click on Appointment.


    thanks
    H@rdik Pancholi
  5. Pana
    Admin
    Pana avatar
    748 posts

    Posted 08 Sep 2011 Link to this post

    Hello,

    Note that my project uses Visibility and works fine while yours try to set the IsEnabled. The problem is when RadMenuItem is se a Command the IsEnabled will depend on the CanExecute on the command. It will lead to unexpected results playing around with both the Command and IsEnabled on the RadMenuItem. Please follow my approach with the Visibility or if you want to be setting the IsEnabled set the Command to null when you set the IsEnabled to false.

    Please check the attached project. Also it opens the RadMenu always no mater the view even the first time. I have added multiple view modes.

    Greetings,
    Pana
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  6. Hardik
    Hardik avatar
    61 posts
    Member since:
    Jun 2011

    Posted 14 Sep 2011 Link to this post

    Hi telerik,

    I used visibility and its working fine. but one problem is still there. If I right click on reservation and context menu opened as per that, after that I right click on any slot in schedulerview then still it behaves same as appointment right click.

    As I left click on slot(selection of slot) and again right click on slot then its working fine.

    Any solution for this.?


    Thanks
    H@rdik Pancholi
  7. Hardik
    Hardik avatar
    61 posts
    Member since:
    Jun 2011

    Posted 16 Sep 2011 Link to this post

    Hi,

    Its working now. One more thing I want translation of header. Wants in other languages also.

     <telerik:RadMenuItem Header="Delete Reservation..."  CommandTarget="{Binding Menu.UIElement, RelativeSource={RelativeSource Self}}"
                                Command="schedule:RadScheduleViewCommands.DeleteAppointment" >


    Thanks
    H@rdik Pancholi
  8. Pana
    Admin
    Pana avatar
    748 posts

    Posted 16 Sep 2011 Link to this post

    Hi,

    Have you tried using the localization manager. It should be possible to set

    telerik:LocalizationManager.ResourceKey="TranslateMeKey"

    And add the "TranslateMeKey" in a custom translation table as shown in the help page.

    Kind regards,
    Pana
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  9. Khaled
    Khaled avatar
    5 posts
    Member since:
    Sep 2011

    Posted 22 Nov 2011 Link to this post

    it seems there is a bug when using a right-to-left language, the coordinate is calculated as if there is a mirror, I mean if you want to click an item on the left you will have to click in the opposite right, but the context menu will be rendered on the wrong position two, is there a workaround for this issue?
  10. Khaled
    Khaled avatar
    5 posts
    Member since:
    Sep 2011

    Posted 22 Nov 2011 Link to this post

    it seems there is a bug when using a right-to-left language, the coordinate is calculated as if there is a mirror, I mean if you want to click an item on the left you will have to click in the opposite right, but the context menu will be rendered on the wrong position two, is there a workaround for this issue?
  11. Khaled
    Khaled avatar
    5 posts
    Member since:
    Sep 2011

    Posted 22 Nov 2011 Link to this post

    it seems there is a bug when using a right-to-left language, the coordinate is calculated as if there is a mirror, I mean if you want to click an item on the left you will have to click in the opposite right, but the context menu will be rendered on the wrong position two, is there a workaround for this issue?

    I am sorry but everytime I posted my post I get a server error, I was able to see my posts yesterday, but today I saw that there are 3 same post, I wish moderators delete the duplicated post.

    Thank you
  12. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 28 Nov 2011 Link to this post

    Hi Khaled,

    I tested this using both RightToLeft and LeftToRight flow directions and it behaved exactly as the WPF's original context menu. You can find a video what I tried. Did I miss something?

    Best wishes,
    Ivo
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
DevCraft banner