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.
Unfortunately, activation email could not send to your email. Please try again.

Itemssource of DocumentContainer

Thread ID:

Created:

Updated:

Platform:

Replies:

80731 Apr 24,2009 03:31 AM Apr 28,2009 11:55 AM WPF 3
loading
Tags: Tools
Arjan van der Stelt
Asked On April 24, 2009 03:31 AM

Hi,

I have an WPF application that uses a DocumentContainer to show multiple windows. The windows are added programmatically using the following lines of code:

TestDoc temp1 = new TestDoc();
DocumentContainer.SetHeader(temp1, "test1");
this.MyContainer.Items.Add(temp1);

Where TestDoc is just a selfmade user control.

This works, but then I found out that DocumentContainer contains the ItemsSource property. So it would be great if I could use data binding to bind to an ObservableCollection. But when I tried this I got the following error:

'Binding' cannot be set on the 'ItemsSource' property of type 'DocumentContainer'.

Is it possible to bind an ObservableCollection, for example, to the ItemsSource of the DocumentContainer?!

Thanks,

Arjan




Prabhu P [Syncfusion]
Replied On April 27, 2009 03:30 PM

Hi Arjan,

Thank you for your interest in Syncfusion products.

Yes. It is possible to bind an ObservableCollection data to the DocumentContainer’s ItemsSource property. We have created a simple sample to demonstrate this feature. Please find the sample from the link given below.

http://files.syncfusion.com/support/tools.WPF/7.2.0.20/80731/main.htm

Hope this will fulfill your requirement. Please let me know if you have any other queries.

Thanks,
Prabu



Arjan van der Stelt
Replied On April 28, 2009 03:02 AM

Hi,

Thank you for the fast solution for my problem, it realy helped me.
I'm now able to bind the ItemsSource to an ObservableCollection. Here is my code:

public partial class ARACWindow : RibbonWindow
{
private ObservableCollection MyDocuments;
this.MyDocuments = new ObservableCollection();
this.MyContainer.ItemsSource = this.MyDocuments;
}

I added the property MyDocuments to the window and set the ItemsSource of the DocumentContainer to that property.

It workes great, now I can just add controls to the ObservableCollection and they are being showed in the DocumentContainer.

Thanks,

Arjan



Prabhu P [Syncfusion]
Replied On April 28, 2009 11:55 AM

Hi Arjan,

We are glad to hear that your problem has been resolved. Please let us know if you have any other queries.

Best Regards,
Prabu



CONFIRMATION

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.

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.

;