Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1415
Programmatically adding TemplateEditorValueBinding
posted

Hi, I'm trying to add a TemplateField programmatically in C#, but I cannot seem to get the binding correctly.  How can I reference TemplateEditorValueBinding correctly?

 var text = new FrameworkElementFactory(typeof(TextBlock));
text.SetBinding(TextBox.TextProperty, new Binding { Path = new PropertyPath("{editors:TemplateEditorValueBinding}")});
var dtDisplay = new DataTemplate {VisualTree = text};
 field.DisplayTemplate = dtDisplay;

Thank you