[DevExpress Support Team: this thread was cloned from A927: How to inherit grid columns and use them in the XtraGrid]
Hi, I'm using this example but, I don't Save and Restore Layout ColumnEdit in RepositoryItem.
How to Save and Restore Layout ColumnEdit in RepositoryItem?
We have closed this ticket because another page addresses its subject:
How to inherit grid columns and use them in the XtraGridRestoring layout doesn't restore a column's inplace editor
Answers approved by DevExpress Support
This happens because:
- You save the layout using the GridView.SaveLayoutToXML execution; so there is information about columns with particular names in the layout *.xml, and this is fine.
- Then, you re-start the application.
Since a GridView doesn't have any columns, new columns are created. - You restore the layout using the GridView.RestoreLayoutFromXML execution.
Since there is no information about these newly created columns in *.xml file, but about old columns, the layout restored as you see.
To resolve this issue, i.e., to make the GridView.RestoreLayoutFrom~ execution restore the previous layout, you need to predefine the required columns. That is, with the same names as previous columns - those stored in layout file. I've modified your sample accordingly.
Please test it and let me know your results.
See also:
Saving and Restoring Layout Basics,
Saving and Restoring Layout,
How to: Save a Grid's Layout Between Application Runs
Hi Ahmet,
Your scenario is not completely clear to me. Would you please describe it in greater detail? Please clarify what settings you wish to restore. A sample project that contains your grid bound to a test portable data source and screenshots that illustrate the expected result will be greatly appreciated.
Posted by Ahmet CAKIR
I have CustomGridControl, CustomGrid and CustomGridColumn .
I'm creating gridColumns and I'm adding Reporsitroy Items to columns at runtime.
Finally I'm saving to the xml and Restore from the xml. but don't load added repoItem.
How can I do it?
Thanks…
Hi Jannet
I'm really sorry
Can you help me for this problem?
OK, I see what you are talking about. Please give me a little more time to investigate your project and suggest a possible solution. I will get back to you ASAP.