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 643009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:14:11+00:00 2026-05-13T21:14:11+00:00

Well i have a control thats placed in a usercontrol and it exposes a

  • 0

Well i have a control thats placed in a usercontrol and it exposes a ICommand with a DepenceyPropety(ShowCommand),
and then i have a datagrid (wpf toolkit) with a few columns and one of them has a delete button

<Custom:DataGrid Margin="0" ItemsSource="{Binding Todos}" AutoGenerateColumns="False">
    <Custom:DataGrid.Columns>
      <Custom:DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
        <Custom:DataGridTemplateColumn>
            <Custom:DataGridTemplateColumn.CellTemplate>
                <DataTemplate>
                    <Button CommandParameter="{Binding}"
                            Command="{Binding ElementName=ConfirmDeleteDialog, Path=ShowCommand}" 
                            Content="Delete" />
                </DataTemplate>
            </Custom:DataGridTemplateColumn.CellTemplate>
        </Custom:DataGridTemplateColumn>
    </Custom:DataGrid.Columns>
</Custom:DataGrid>
<local:ConfirmationDialog x:Name="ConfirmDeleteDialog" 
                          Title="Confirm delete!" 
                          d:LayoutOverrides="Width" 
                          Message="Are you sure that you want to delete the selected todo?" 
                          YesCommand="{Binding DeleteCommand}" />

and as im in a DataTemplate it does not find the element, and i can’t combine ElementName and Relative source so how would i define a binding that can access an element declared outside the datatemplate?

The command im trying to bind to is located on ConfirmationDialog.YesCommand..

  • 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-05-13T21:14:12+00:00Added an answer on May 13, 2026 at 9:14 pm

    Well i solved it this way i changed my dialog to a to inherit from ContentControl instead of Control and added a content holder in it..

    after that i moved the dialog so it wrapped the whole control, after that i added a routed event that i can listen to and that worked like a charm.

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

Sidebar

Related Questions

I have a WPF UserControl with binding converters referenced like this: <UserControl x:Class=MyControl x:Name=MyControl
I'm trying to display all orders placed and I have a primary accessdatasource control
I have the following definition at the top of my .ASCX file: <%@ Control
I have a user control that uses the standard if(!IsPostBack){//initialize myself} paradigm to avoid
Well I have a very rough version of gomoku working now. I'm using Jquery,
I'm setting up a User Control driven by a XML configuration. It is easier
I have two libraries and a single application assembly project layout and I'm wondering
Yes, there is a similar question here . However, that question doesn't seem to
(Revised for content quality) We had built forms based application for a customer based

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.