You should be able to grab the data context from sender without iterating the
visual tree at all. Data contexts flow down automatically.
Cheers,
Jordan.
On 06/12/2011, at 11:03 PM, "Greg Keogh" wrote:
> Folks, I think I’ve outsmarted myself. I have a DataGrid bound with a
> template colu
27;
Subject: RE: DataGrid row button click (answered?!)
To find the DataGridCell that contains the clicked button I found that a
simple iteration up through the Parent properties of the sender eventually
reaches the cell. I don't go to the trouble of using the VisualTreeHelper as
the Parent
To find the DataGridCell that contains the clicked button I found that a
simple iteration up through the Parent properties of the sender eventually
reaches the cell. I don't go to the trouble of using the VisualTreeHelper as
the Parent property was enough in this case (I was doing that in a WPF app
If you are using MVVM, then you can bind your button to a command on the object
being bound to.
From: ozsilverlight-boun...@ozsilverlight.com
[mailto:ozsilverlight-boun...@ozsilverlight.com] On Behalf Of Greg Keogh
Sent: Tuesday, 6 December 2011 8:04 PM
To: 'ozSilverlight'
Subject: DataGrid row