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. Image for the cookie policy date
close icon

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

Hi,
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
Regards
Sabrina





3 Replies

AK Ashok Kumar Murugesan Syncfusion Team 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.

Sample:DockingManager

Regards,
Ashok Kumar M.



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

It works correctly, Thanks
Sabrina


AK Ashok Kumar Murugesan Syncfusion Team 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.

Regards,
Ashok Kumar M.

Loader.
Live Chat Icon For mobile
Up arrow icon