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).

 

The DataContext property of the cell can luckily be cast to the object type
in the bound collection. I get the creeps about how fragile this all is,
having no strongly typed or nicely indexed values to work with. Are we sure
this is the way we're intended to do these things? I have this feeling of
unease that there is some technique that I'm missing, but I doubt it.

 

> If you are using MVVM, then you can bind your button to a command on the
object being bound to.

 

How do you pass to the command handler something to identify the
button/row/object being acted upon?

 

Greg

_______________________________________________
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight

Reply via email to