Hi All,
i have a winform ui that starts up and loads layout from xml. The user can sort, resize, hide columns. when they do that i want to set a flag so that when the app closes it will say , "layout has changed do you want to keep the changes?" i'm not able to find where to set the flag.
can you help?
Hello Al,
To properly keep track of the layout currently in use before, while, an after the end user is in session you can perform the following:
ie. The following article will help you perform the commands needed below:http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=1036
1. Save the grid's current layout to a memory stream immediately upon first use. (form's load event) 2. Overwrite stream 1 (step 1) if you plan on loading any preexisting layout or expect your user's to load their own (eg. Open Dialog ==> choose existing layout)
-- changes are then made by the end user
3. Handle the close event of the form and create a second new stream (do not overwrite stream 1).4. Do a comparison on the closing event between the two streams based on the length in bytes. If any changes were made you could then proceed with your message and a popup, if necessary, MessageBox with buttons.YesNoCancel.
Let me know if you have any questions regarding this matter.
Thanks for responding Michael, that does make sense but i think this code is making additional layout changes at runtime. it loads from a xml file but then applies additional changes. im not capturing the exact last layout. so my beforestream.length != afterstream.lenth regardsless of any UI changes made by user. i'll work on finding the property being set.
thanks again