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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Cannot change the datasource binded with a TreeView ?

Thread ID:

Created:

Updated:

Platform:

Replies:

93823 Apr 6,2010 05:58 PM UTC Apr 9,2010 06:18 AM UTC Silverlight 1
loading
Tags: Tools
Philippe Chessa
Asked On April 6, 2010 05:58 PM UTC

Hi,

I modified the Syncfusion.Tools.Silverlight.Samples.TreeViewDataBindingDemo this way:

// Place the initialisation code in a procedure.
ObservableCollection itemsSource = new ObservableCollection();
private void Initialize()
{
var temp = new ObservableCollection()
{
new ObjectModel("Division 1",
new ObjectModel("Director Fire & Life Safety", new ObjectModel("Asst Dr.Emergency Preparedness"),new ObjectModel("Fire Safety Specialist")),
new ObjectModel("Director Security",new ObjectModel("Medical Security"),new ObjectModel("Campus Security")),
new ObjectModel("Manager Training & Accreditation"),new ObjectModel("Director Police Operations",new ObjectModel("Staff Assistant"),new ObjectModel("Patrol Captain",new ObjectModel("Commander Sergeant",new ObjectModel("Police Officers"))),new ObjectModel("Asst Dr,Investigations",new ObjectModel("Directives Investigator"))),new ObjectModel("Director Operations")),
new ObjectModel("Division 2",
new ObjectModel("Director Security"),
new ObjectModel("Asst Director Security"),
new ObjectModel("Asst Director Campus Security")),
new ObjectModel("Division 3",
new ObjectModel("Teaching Professional",
new ObjectModel("Co-ordinator"))),
};

itemsSource.Clear();
foreach (var item in temp)
itemsSource.Add(item);
}

// Call this procedure in the constructor, before InitializeComponent();

Everything works fine.
Then, I added a button, with the following code :

private void Button_Click(object sender, RoutedEventArgs e)
{
Initialize();
}

When I click the button, I get a very nasty error message (see attachment).
Looks like it's not possible to modify the collection after the binding has been established.
Am I doing something wrong ?

(I need this feature in my application, where the datasource can be updated by a Web Service)

Thanks in advance for you help.

Philippe
(Essential Suite 8.1.0.30)





Snap5_78741d6c.zip

Prathap K.N [Syncfusion]
Replied On April 9, 2010 06:18 AM UTC

Hi Philippe,

Thanks for using syncfusion products.

We can also able to reproduce the exception which you have mentioned. Sorry for the inconvenience caused. This issue is fixed and please create a new ticket in Direct track so that we can send you the fixed custom build assemblies.

Please let us know for further clarifications.

Regards,
Prathap

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.

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

;