Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to save a layout of LayoutControl together with its child controls

$
0
0

By default, if you save a layout of LayoutControl, settings of layout items are saved (Save and Restore Layout ). When you load the saved layout, layout items will be created with saved settings only if LayoutControl contains child controls, whose names exist in the saved layout. Otherwise, layout items will not be created. 


This example illustrates how to save settings of the child controls, too. For this, we have created two extension methods: SaveLayoutExToXml and RestoreLayoutExFromXml. These methods allow you to save and load child controls' settings. It makes sense to use these methods if it is necessary to re-create child controls from the saved layout with the saved settings. If a child control with the same name exists in LayoutControl, it will be removed and replaced by a new one retrieved from the saved layout. This approach is based on using a custom XmlXtraSerializer class. 


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>