I have an UltraTree bound to an UltraDataSource. Every time I close my form, I get a dialog with this text and yes/no buttons...
The 'DataSource' of the UltraTree has been changed.Would you like to remove the previously autogenerated columnsets?
This occurred after a migration to VS2005 (and of course to a newer volume of Infragistics). As this is rather annoying, does anyone know why and how I can stop this?
Spasibo, Alex
Hi Alex,
This message should only come up if there is an actual structural change to the data source. The fact that you are getting this message every time you close the form indicates that your data source is sending change notifications to the tree. If you are saying that the data source is not actually being changed, then something is wrong.
Can you duplicate this in a small sample project? If so, you should Submit an incident to Infragistics Developer Support so they can check it out and get it corrected.
I can duplicate this, so I will go ahead and submit an incident.
Hello Mike,
is this problem solved? I have attached a sample project where I get this message everytime I run my test app.
By the way I wonder why the handler TreeOrganisation_ColumnsetGenerated is not called.
Checking out the column sets properties at designtime I see that two columns sets are generated. One with key of empty string, one with Key "Childs". Why I have these two column sets and how I can access it in code to set the node text column, hide some columns etc.?
At the moment nothing is showed as node text.
My tree is bound to a project data source (class OrgBase). OrgBase is the base class of a composite pattern.
Regards
Markus
Hi Markus,
mac_swit said:is this problem solved? I have attached a sample project where I get this message everytime I run my test app.
I ran your sample and I don't get any message, so it looks like the issue is resolved. I, of course, am using the latest service release.
How to get the latest service release - Infragistics Community
mac_swit said:By the way I wonder why the handler TreeOrganisation_ColumnsetGenerated is not called.
Probably because no ColumnSets are being generated at run-time. This is because all of the ColumnSets that are needed already exist - they were generated at design-time.
mac_swit said:Checking out the column sets properties at designtime I see that two columns sets are generated. One with key of empty string, one with Key "Childs". Why I have these two column sets and how I can access it in code to set the node text column, hide some columns etc.?
I'm not sure what you are asking. They were automatically generated based on the data source the tree is bound to. The key of the ColumnSet is the same as the band name of the band in the data source. You can modify the columns using the ColumnSet Designer at Design-time or the property grid.. Or you could set NodeTextColumn in code in the Form_Load.
Hi Mike,
thanks for your answer. As you can see I'm using a project data source object as data source for the tree. The underlaying class is 'OrgBase' (the root class of my composite pattern).
At design time the tree generates always two column sets, one with empty key for the columns (properties) of OrgBase and one with key = "Childs", the Name of a list property.
The message we talking about, seems to be a bug in visual studio or in the tree. Resetting the DataSource of the tree, the generated columns sets remains in the designer. And if I make any changes to my business object 'OrgBas', changes are not reflected in the generated column sets in the designer. I guess that's, however, the reason for the message. I have to remove, save, recompile and playing a little bit around and sometimes visual studio hangs.
My current solution for this is setting the data source at runtime. In this case the event columnssetgenerated will be called as you said.
Maybe I will update to the newest version / newest service release.
I am familiar with the message. It comes from the tree designer.
By default, the tree automatically generates ColumnSets based on the data source. When the data source changes or is reset, the tree gives you a warning before it blows away the existing ColumnSets and creates all new ones. This is so you don't accidentally lose any changes you might have made to the existing ColmunSets.
But this message only displays when something changes that would cause the tree to re-create the ColumnSets - such as setting the DataSource/DataMember or making a structural change to the data source.
If you make changes to the ColumnSets and then change the data source, you have two choices:
1) Let the three regenerate the ColumnSets to match the data source, in which case you will lose any changes you made.
2) Don't let the tree regerentate the ColumnSets, in which case, your ColumnSet changes will remain intact, but the tree's ColumnSet may be out of synch with the changes in the data source. You could, of course, update the ColmunSets manually to match the data source. If you added a column to your data source, you could add the same column to the ColumnSet, for example.
mac_swit said:My current solution for this is setting the data source at runtime. In this case the event columnssetgenerated will be called as you said.
This is my preferred solution, too. If you set the DataSource of the tree at run-time, you can modify the ColumnSets in code in the ColunSetGenerated event and you get the best of both worlds since the tree will always generate the ColumnSets based on the data source structure and then your modification occur after that.