I want to know if the user has changed the grid settings since it was originally loaded. That way I can ask the user if he would like to save the setting when exiting the application. How do I find out if the grid setting have changed since it was loaded?
Thanks!
Hm, that sounds like an excellent idea. :)
I was thinking of using MemoryStream then just use ToArray() to get the byte[ data
There's no library function to compare the arrays so check the lengths are equal and just use a for loop to compare the contents.
Jonesmar, your idea is very good one. It would definitely address the "catch-everything" problem. So there is binary compare function? I was not aware of that. if you have some keywords or sample code, can you copy/paste to me?
Could you serialize and store the grid layout to a stream (after you have bound the data and initialized the grid etc.) using DisplayLayout.Save, then serialize again before closing and binary compare the two streams to see if anything has changed? This covers the 'anything persistable' criteria!
You also get some control over what gets compared this way through the PropertyCategories arg.
Mike Saltzman"] Out of curiosity, are there cases where the user will not want to save the settings?
Out of curiosity, are there cases where the user will not want to save the settings?
I think it is reasonable to ask a user to save if he cares to use the setting again.
In my case, I have this elaborate scheme implemented which saves the settings for for the various Infragistics controls incl dockmanager, etc that the application uses. I would like to implement such that the controlling persistance manager would interrogate each control it manages whether its persistable setting have changed and if so, it would prompt the user to save the setting at time of form closure. That way if user has forgotten to save he has an opportunity (kind of like when we try before saving a change in Word, VisualStudio, etc)
I will submit a request as you suggest.