When I am using an UltraGrid control, I am saving our default settings inside of an UltraGridLayout object, and I would like to have the ability to go back to these settings on the fly. So when a user moves around columns, hides columns, ect. when they invoke a reset of the settings I would like to go back to what is saved in the UltraGridLayout object.
I am currently invoking the DisplayLayout.Load method as follows to reset the settings:
myGrid.DisplayLayout.Load(_defaultSettings, PropertyCategories.All);
This does reset the settings on the grid if I were to close the form and reopen it, but it does not update the grid on the fly. Is this the right method to be using, or is there another way of doing this?
I will install the latest service release and retest. Thanks.
bsquires_daou said:Is there a new technique for Loading layouts in 2009v1?
No, of course we would not change this behavior and intentionally break existing applications.
I think this may be a bug. Are you using the latest service release? If not, then you should try downloading it and see if that helps. If not, then I think this issue is probably fixed internally and so the fix should be available in the next service release.
You should Submit an incident to Infragistics Developer Support and ask to be notified when the fix becomes available.
Also, if you can duplicate this problem in a small sample project, we could test it out and make sure it's actually fixed.
I am having the same issue about resetting the grid to use a stored Layout on-the-fly. In 2007v3, our application initialized the grid layout and saved it into the Layouts collection. Then when a user wanted to reset the grid to the original layout we would simply use ultraGrid.DisplayLayout.Load(ultraGrid.Layouts["SavedLayout"], PropertiesCategories.All) and it would work as expected. However, in 2009v1, it does not update on-the-fly. In fact, it will work if you step through the code and query the local variables, but not if you just step through the code line by line. I have even tried a call to this.Update to refresh the form itself without success. Is there a new technique for Loading layouts in 2009v1?
Hi,
I'm not sure what's going on, then. There's no reason I can think of why loading or copying a layout would simply do nothing. Are you sure you are not somehow saving the current layout into your layout variable after the user modified it? Or that you are not loading the layout again in some event that follows your load call?
I tried the CopyFrom method instead of Load, and it seems to work the same way where it is not reseting the grid on the fly. When I close my form and reopen it, it will show the default settings after a CopyFrom.
I am using NetAdvantage for .NET 2008 Vol 1 CLR 2.0 if that does make a difference.