Ticket T102741
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

How to inherit grid columns and use them in the XtraGrid

Restoring layout doesn't restore a column's inplace editor

created 11 years ago

[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?

Show previous comments (1)
DevExpress Support Team 11 years ago

    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?

      DevExpress Support Team 11 years ago

        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.

        Answers approved by DevExpress Support

        created 11 years ago (modified 11 years ago)

        This happens because:

        1. 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.
        2. Then, you re-start the application.
          Since a GridView doesn't have any columns, new columns are created.
        3. 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

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.