Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9133743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:32:25+00:00 2026-06-17T08:32:25+00:00

I try to bind the IsEnabled property in a context menuitem. The context menu

  • 0

I try to bind the IsEnabled property in a context menuitem. The context menu is placed in a Devexpress GridControl.View.

I assume that the problem is in the DataContext. The barbutton item is searching for the property HasPermissionDelete in the DataContext of the grid. But this isn’t the datacontext of the viewmodel. My property HasPermissionDelete is on the ViewModel.

I’m using caliburn.micro.

Can you help me for fixing this binding?

My xaml code:

<dxg:GridControl.View>
    <dxg:TableView x:Name="gridTable" AllowSorting="True" NavigationStyle="Row" MultiSelectMode="Row" AutoWidth="True" AllowEditing="False" AllowFilterEditor="True" AllowDrop="True" AllowGrouping="True" ShowGroupPanel="False" AllowMoveColumnToDropArea="True" SelectedRowsSource="{Binding SelectedUsers}">
        <i:Interaction.Triggers>
            <i:EventTrigger EventName="RowDoubleClick">
                <cal:ActionMessage MethodName="Edit" />
            </i:EventTrigger>

            <i:EventTrigger EventName="Loaded">
                <cal:ActionMessage MethodName="InitializePrintableSource" >
                    <cal:Parameter Value="{Binding ElementName=gridTable}"></cal:Parameter>
                </cal:ActionMessage>
            </i:EventTrigger>
        </i:Interaction.Triggers>

        <dxg:TableView.RowCellMenuCustomizations>
            <dxb:BarButtonItem x:Name="btnDelete" Content="{lex:LocText Translations:Delete, Assembly=Prosa.Common.Modules.UserManagement}" IsEnabled="{Binding Path=HasPermissionDelete}"/>
        </dxg:TableView.RowCellMenuCustomizations>
    </dxg:TableView>
</dxg:GridControl.View>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:32:26+00:00Added an answer on June 17, 2026 at 8:32 am

    Even if you use Caliburn Micro you can still fall back to standard XAML binding. I will make the assumption that your DevExpress DataGrid is inside a simple Grid, which is the root element for your Page or UserControl. So, you will have something like this structure:

    <Grid x:Name="root">
    
          <dxg:GridControl>
           ...
           (your GridControl.View and everything else here)
           ...
          </dxg:GridControl>
    </Grid>
    

    So, to avoid using the GridControl’s DataContext in your button, you can bind to the DataContext of your root grid, which in this case would be the corresponding ViewModel. Bind your button like this:

    <dxb:BarButtonItem x:Name="btnDelete" Content="{lex:LocText Translations:Delete, Assembly=Prosa.Common.Modules.UserManagement}" 
    IsEnabled="{Binding ElementName=root, Path=DataContext.HasPermissionDelete}"/>
    

    You can always get to the datacontext you want in this way, by setting the Name of the element (“root” in this example) and then referring to it in the binding. You can also bind to elements with no name, but the binding expression is much more complicated (you have to use RelativeSource and select the element type).

    Hope this solves your problem!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to bind a datagrid view in a user control that is docking
I have this f:viewParam that I try to bind validate and convert a userId
I discovered a problem in my code when I try to bind multiple sockets.
When I try to bind in an MVC 3 view (using an @Html.DropDownList helper)
im new to wpf and try to bind the Items.Count Property of a static
I have a DevExpress xtraGrid which I want to bind. When I try to
I'm new to WPF and I'm try to bind a dependacy property. I want
When I try to bind overloaded property in PDOStatement::bindParam method, $stmt->bindParam(':'.$field.'', $this->$field, $pdoparam); ...
I'm having an issue when I try to bind a visibility property to a
I try to bind an IPv6 server socket in Java 1.6 on Windows 7,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.