My users want to change column order, column width, etc. in an UltraWinGrid based on a selection from a combobox and to automatically restore those changes whenever the click on that selection. I've been reading up on savelayout/loadlayout but is there a way to save the layout in a SQL Server table?
JamesJay
Hi,
You can save the layout to either binary or XML and to a file or a stream. So one thing you could do is save the layout to a text Stream as XML and then store that xml in a database.
HOWTO:How can I save a stream to a database?
Mike, thanks for the code sample. It worked great except...when I save and load the PropertyCategories I lose summary for one of my grids. It disappears and we really need the total it previously displayed. Have you ever heard of this or have a suggestion? JamesJay
Ok, now I'm really getting confused.
The only thing I find in help for PropertyCategories is that it's an enum. I don't understand why you would have a choice of property categories if you don't know what each one does or is for. How can I use them if I don't know what they do?
I tried using PropertyCategorie.All but I lost my Summary row when the DisplayLayout was loaded. There has only been one other developer on this project and he didn't do anything with DisplayLayout that should affect the summary row when the DisplayLayout is loaded. I have not done any manipulating of DisplayLayout either.
I have also gotten some strange behavior from loading PropertyCategories like columns previously set to NoEdit getting changed to AllowEdit and columns hidden property being changed from True to False.
All I am trying to do, all I need to do is save the grid's column widths and column order for a user and restore them when the user opens trhe application. I wanted the definitions for the PropertyCategories to see if I could limit changes to just col width and order and, hopfully, not lose the summary row when the categories are loaded.
Hi James,
JamesJay said:The only thing I find in help for PropertyCategories is that it's an enum. I don't understand why you would have a choice of property categories if you don't know what each one does or is for. How can I use them if I don't know what they do?
They are documented here:
http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v8.2~Infragistics.Win.UltraWinGrid.PropertyCategories.html
JamesJay said: I tried using PropertyCategorie.All but I lost my Summary row when the DisplayLayout was loaded. There has only been one other developer on this project and he didn't do anything with DisplayLayout that should affect the summary row when the DisplayLayout is loaded. I have not done any manipulating of DisplayLayout either.
If you specified All, then everything should be saved, including the summaries. Assuming you specified All when you both saved and loaded the layout, then I can't explain why the summary row is lost. It should not be. Either something in your code is removing it somehow or there's a bug there.
Perhaps you should Submit an incident to Infragistics Developer Support and include a small sample project demonstrating the behavior you are getting so they can take a look.
Mike,
The problem with missing summary row was my. I wasn't saving the original default settings so they were overwritten by a version that didn't have a summary row. My fault, (which I'm kind of releaved about. I really needed that summary row).
The documentation for the PropertyCategories Enum, well that's not much help. I mean, the nuns at St. Robert's School taught me to never use the word in writing the definition for that word. "AppearanceCollection: Serialize Appearance Collection" is not helpful at all. It says nothing more than the category itself.
But now that I know what I was doing wrong it shouldn't matter if I'm saving all or not so I think I'm ok.
Thanks for your imput.
JameJay
Well, I agree that those descriptions aren't very helpful. There's a link at the bottom of the help topic page where you can write to the documentation team and comment about the page. :)
I'm writing the documentation team now. I have wasted far too much time trying to figure out which PropertyCategory to use.
It seems even using "All" doesn't capture which columns are shown/hidden.
kordeneaux said:It seems even using "All" doesn't capture which columns are shown/hidden.
The All category most certainly does include the hidden property on the column. If that's not working for you, then something else in your application is blowing away those settings.