I try using Devexpress Layout-Control (For costume usage). So I want add all item’s exist in Available-Item Section to Layout-Control root as Layout-Item via code .
So it must be possible, But How? (I don’t know, any solution 😉
Edit 1 sorry For less information at first time
Let me explain What I do in My example, I Use code to create one or more Control in Layout-Control at Form-Loaded Event.
After that in one Button_Click, I Use :
Layout1.WriteToXML(XmlWriter_Object);
to save Layout Current View. These step work well! if I want recover that view at next step with this command :
Layout1.ReadFromXML(XmlReader_Object);
As Result I got all item’s(which created via code) in Available-Item Section! So this is My problem!
Why These Happend?
Ps: Both XmlReader_Object and XmlWriter_Object refer same file on machin.
To move an item from the Available Items list onto the LayoutControl, do the following.
1) Remove the item from the LayoutControl.AvailableItems collection:
2) Add this item to the layout. For instance, you can use the following code to append the item to a group:
Update on Edit1:
When creating layout items dynamically(in code), it is necessary to register their identifiera(names) using the RegisterName method. The code can look as follows:
This way, everything should work as expected.