Hello,
I am looking for a way to clone the ultra grid as it is – to get the all copy of it with all of its contains .
Thanks allot
Yaniv,
You could save the layout of the grid and then load it in a new grid, such as:
this.ultraGrid1.DisplayLayout.SaveAsXml("MyLayout.xml");this.ultraGrid2.DisplayLayout.LoadFromXml("MyLayout.xml");
You won't be able to copy the data since the grid does not maintain the data; this is the responsibility of the DataSource. You could bind the other grid to the same DataSource, but if you don't want the same changes to be reflected in both grids, you'd have to clone the DataSource as well.
-Matt
I’m afraid I need further assistance.
I need the Clone() method because I’m trying to export the grid into a PowerPoint table- I need to export all visible cells and rows, and keep the formatting that the grid currently have (including fonts, colors, etc.)
I’ve seen that in the Excel exporter you created, you create an exact clone of the grid – can’t you expose this method?
Thanks any way.
Actually, we don't really clone the whole grid, just the DisplayLayout.
If you want to export the grid, you can use the same interface that the ExcelExporter uses. The grid actually drives the export process. What you do is create an object that implemens IUltraGridExporter and call the Export method on the grid passing in your object. The grid will then call methods on the object you gave it. It will pass you in a cloned layout and then fire events on your object for each row in the grid in order. This is exactly what the ExcelExporter and DocumentExporter use.
thank you
What are the essential properties to clone?
Thanks