Skip to content

ContextMenu not showing up when right-clicking anywhere on a DataGrid #508

Closed Answered by sccombp
waylaa asked this question in Q&A
Discussion options

You must be logged in to vote

You can use ContextFlyout instead (I have confirmed this will work using FluentAvalonia).

At the top of your axaml file add the following reference (if you do not already have it.)

xmlns:ui="using:FluentAvalonia.UI.Controls"

replace your <DataGrid.ContextMenu> section with ContextFlyout

      <DataGrid.ContextFlyout>
        <ui:FAMenuFlyout>
          <ui:MenuFlyoutItem Text="Create" IsEnabled="{Binding Collections, Converter={StaticResource CollectionToBoolConverter}}" />
          <ui:MenuFlyoutItem Text="Rename" IsEnabled="{Binding Collections, Converter={StaticResource CollectionToBoolConverter}}" />
          <ui:MenuFlyoutItem Text="Delete" />
          <ui:MenuFlyoutItem Text="Copy" 

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@waylaa
Comment options

Comment options

You must be logged in to vote
1 reply
@waylaa
Comment options

Answer selected by waylaa
Comment options

You must be logged in to vote
3 replies
@waylaa
Comment options

@timunie
Comment options

@waylaa
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants