Is there anything that might prevent the SaveAsXml method from saving the band and column settings?
I'm calling the method at a point after InitializeLayout has run. For some grids, the SaveAsXml method saves all of the column data (position, size, etc). For some others, the exported XML file doesn't contain references to the BandsCollection, ColumnsCollection, or SortedColumnsCollection.
For the problem grid, the DataSource is bound at design time and the grid displays everything correctly when run. I tried both SaveAsXml(character) and SaveAsXml(character,PropertyCategories.All). In both cases, one grid I'm testing exports correctly, the other doesn't.
I checked at the point I'm calling the export and the grid has a bands collection (1 band) and the band has 17 columns. I've attached the two XML files. Any help would be greatly appreciated.
Regards,
Jim
Hi Reto,
It's impossible for me to guess if this is the same issue, but it sounds like it might be. The best thing for you to do is get the latest service release and see if it fixes the issue. I suspect it will.
If not, we can certainly look into it.
Hi Mike,
I also experience a bug in v9.1.
Rearranging, sorting etc does work. But if I do a group-by a column then there is an error.
Example Data:
a,b,ca,d,eb,f,gGroupBy First Column gives me two groups: group a and group b:
a,b,ca,d,e------- separator -----b,f,gHowever after a save and reload, I get three groups: group a, group a and group b, each with one item:
a,b,c------- separator ----- a,d,e------- separator ----- b,f,gIs this the same bug as in v9.1.? How I can track the content of the already reported bug and when it will be available?
Best regards,
Reto
Maybe the bug is the culprit.
For now, I've updated our code to run the method at a later point and it seems to work fine. I really can't post a sample because we're not using VS to develop; if you remember from an earlier post we're using the Progress product and so our code sample would need to be translated before you could even try it.
I'll post back if I run into any more issues with this.
Thanks for the help.
So it seems like it's simply a question of referencing the grid control too early? I'm not sure I see how that could be the issue, though. Because you would have to set the DataSource and DataMember on the grid before you load the layout, anyway.So you would have had to reference the grid, anyway.
To further complicate matters, there is a known bug right now in v9.1 and up that sometimes causes the loading of the layout not to work correctly, so you might be running into that issue, as well. The issue will be fixed in the next service release.
If you want to try to duplicate the issue in a small sample project and post it here, I can run it with the latest internal build just to check and see if the issue is, in fact, fixed.
This is looking like a timing issue.
We have a user control that has a utility toolbar that can be wired to a grid. When we run the method to set the utilitybar's grid reference property, that method also runs the SaveAsXml against the grid. We've been using the Load event of our user control to do this.
In the form where the xml is correct, the grid object is defined before the user control. In the form where it's not correct, the grid is defined after. In the incorrect form, I tried moving our method call from the load of the user control to the load of the form and the xml was correct.
While this corrected the xml file, I still need to be sure that the form load is where I want this. The SaveAsXml method is used to temporarily store the default grid settings for the particular grid being loaded. Immediately after saving the defaults, we check to see if the user had saved a modified version of the display layout and load that in. Then, if they decide to reset to the defaults, we reload the ones we saved off. My concern is that in the form load, the user may actually see the column settings change from the defaults to their saved settings.
I'm still looking for the best place to call this so that both the grid and user control are properly loaded but also so the grid changes happen prior to the display of the grid.