We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to bind a ContentControl DockingManager.Header property from code behind

Thread ID:





125015 Jul 14,2016 03:46 PM UTC Jul 19,2016 06:23 AM UTC WPF 3
Tags: DockingManager
sabrina c.
Asked On July 14, 2016 03:46 PM UTC

such said in the subject, I need to dynamically build from code a Docking Manager with some ContentControls.
For One of the ContentControls that shows dynamically some content based on a grid selected row, I need to bind the Header of said content control to a view model property.
From xaml I write:

syf:DockingManager.Header="{Binding Path = SelectedDocument.DocumentName}">

How can I set this binding from code behind? usually to set a binding from code behind I do the following:

txt.SetBinding(TextBox.TextProperty, vBinding);

Where txt is a Textbox and vBinding is my binding.
In case of the Header property I'm confused because the binding is on the ContentControl but the property is in the DockingManager. does it work like this:

ViewerContainer.SetBinding(DockingManager.HeaderProperty, vBinding);
even if the property is on a different control or do I have to use a different notation?
Thank you in advance

Ashok Kumar Murugesan [Syncfusion]
Replied On July 18, 2016 11:52 AM UTC

Hi Sabrina,

Thank you for contacting Syncfusion support.

We have prepared the sample based on your requirement. In this sample we have bound the Text Property of the TextBox to the DockingManager Header property of DockingManager child. Please download the sample from the link below.


Ashok Kumar M.

sabrina c.
Replied On July 18, 2016 04:03 PM UTC

It works correctly, Thanks

Ashok Kumar Murugesan [Syncfusion]
Replied On July 19, 2016 06:23 AM UTC

Hi Sabrina,

We are glad that you have found the solution.
Please let us know if you need any other assistance.

Ashok Kumar M.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon