views:

75

answers:

1

Hi

I have a wpf datagrid containing multiple datagridtemplatecolumns, which all are build up from a datatemplate which contains a textbox.

Now I want to get the binding of the textbox (I have a reference to the template column which textbox's binding I woukld like to determine).

Alternatively it would be nice to return the X:Name of the template column

Any hints? Regards klaus

A: 

Use VisualTreeHelper to travers the grid and find all text boxes (e.g. by name) and then use GetBindingExpression to get the bindig: control.GetBindingExpression(control.TextProperty)

Lukas Cenovsky