2

I've got a WPF grid in which each row represents a file on disk.

grid

What I'd like to do is; when someone right-clicks on a row to show the same context menu as Windows Explorer shows. Any ideas how to implement this? I'm hoping that it will be relative easy but have not sure where to start with this.

enter image description here

H.B.
  • 166,899
  • 29
  • 327
  • 400
Sayed Ibrahim Hashimi
  • 43,864
  • 17
  • 144
  • 178
  • Possible duplicate http://stackoverflow.com/questions/451287/how-do-you-show-the-windows-explorer-context-menu-from-a-c-sharp-application – Haris Hasan Feb 21 '12 at 07:05

1 Answers1

0

Some clue...

<Window.Resources>
        <Style TargetType="DataGridRow">
            <Setter Property="ContextMenu">
                <Setter.Value>
                    <ContextMenu>
                        <ContextMenu.Template>
                            <ControlTemplate>
                                <TextBox Text="{Binding <the property with which column is bound to>}" Height="30" Width="40" />
                            </ControlTemplate>
                        </ContextMenu.Template>
                    </ContextMenu>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
sanguine
  • 281
  • 1
  • 6