Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
802
Copy one grid to another grid
posted

Is there way to copy a grid to another grid without it being a pointer to its originator?

Example:

                    UltraGrid tmpGrid = SourceGrid;

Using this snippet in my code makes tmpGrid a pointer to the SourceGrid, however what I want to do is simply assign all the data and column settings( group-by, filters, and etc), essentially assign every aspect of the SourceGrid to the tmpGrid without it being a pointer. Is this possible? Sorry if this sounds like a stupid question, but I had to ask.

 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    If the grid has a Clone method, you could try that. But I suspect it does not. 

    What you can do is create a new grid, set the DataSource and DataMember, then save the DisplayLayout on the original grid and load it into the new grid. That should cover almost everything. You might have to copy some other root-level properties of the grid. 

Children