0

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

klawusel
  • 681
  • 1
  • 6
  • 19

1 Answers1

0

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
  • 5,476
  • 2
  • 31
  • 39