clone a datagrid

F

Felix

Is it possible to clone a datagrid?

I've created a datagrid on my aspx page, editing various attributes,
adding columns, etc. I would like to, in code, create an arbitrary
number of these datagrids. Any ideas?

I thought that perhaps I should createa a separate "web user control".
I added my datagrid to this control, I compiled, then I dragged the
control to my aspx page. The control did not render in the designer.

The reason I would prefer to clone, or at the very least, have the
control render nicely, is that I would like a non-programmer to be
able to go in and tweak the gui a little. This approach has worked so
far on the project.

Thanks for any help,
Felix
 
P

Picho

Felix,

If the DataGrid class is not Cloneable (does not contain Clone() method) you
can allways inherite from datagrid, let say, MyDataGrid that implements
ICloneable interface (and implement public object Clone() ) that will return
the cloned datagrid.
this method has to do a shallow/deep cloning - as you choose.

Picho
 
F

Felix

Thanks for the suggestion, but I believe that implementing the Clone()
method would not be trivial. How do I easily copy all the attributes
and columns, etc?

Thanks,
Felix
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top