Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

How can I determine the clicked cell in a WPF XAML grid ?

$
0
0

I'm presenting a set of records in a WPF xaml listview with datagridview cells:

 

New-Window -Title 'Select Group' -WindowStartupLocation CenterScreen -Width 700 -Height 500 -DataContext $DeviceCollections -Content {
New-ListView -Margin 5 -DataBinding @{ ItemsSource = New-Binding }  -View { New-GridView -Columns {
                                                                                New-GridViewColumn Name
                                                                                New-GridViewColumn MemberClassName
                                                                                New-GridViewColumn CollectionID
                                                                                New-GridViewColumn Comment
                                                                                New-GridViewColumn CurrentStatus
                                                                            }
                                                                        }
} -On_MouseDoubleClick {
            Global:Get-Selection $window
        } -Show

I added the On_MouseDoubleClick to hook up my get-selection function for the presented window.

The problem is I don't know how to determine the clicked ROW or cell to get that content to be able to process it in the remainder of my Powershell 4 script.

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles