Copying DataGridTableStyles ...

amir100

Centurion
Joined
Mar 14, 2004
Messages
190
Location
Indonesia
How? ... Yupe ... That's the question?

How can you copy a tablestyle from one windows form to another at design time?

Anyone?

Thx.
 
Iceplug said:
Do you need to pass the tablestyle from an older form to a newer form or from a new form to an old form?
No .. no .. no ..

It's at design time, not at running time. You see, there are times when we create similar forms right? When doing it, we sometimes copy the selected components from one form to another.

About DataGrid, when I copied a DataGrid for on form to another, I was hoping the TableStyle will also be copied, but Nooooo ... :D ~sigh.

So, what I'm asking is how do you copy the tableStyle of a datagrid from on form to another?

Thx.
 
Hmm... that's interesting: they aren't copied.
Well, I suppose you're just going to have to either do it at runtime, or copy them manually by yourself.

Or, if you're brave, you can copy all of the TableStyle information in the InitializeComponent sub from one form to the other... you just have to make sure you've copied it all and then press Build. :)
 
Thx Iceplug.

Iceplug said:
Hmm... that's interesting: they aren't copied.
Well, I suppose you're just going to have to either do it at runtime, or copy them manually by yourself.

Or, if you're brave, you can copy all of the TableStyle information in the InitializeComponent sub from one form to the other... you just have to make sure you've copied it all and then press Build. :)

A risky choice :) with a definite result. ;)
 
Just posting in case anybody else is running into this same problem. I found a cumbersome work-around for copying tablestyles and columnstyles from one form to another form. I am using VS .NET 2003 Enterprise Edition (just in case it matters)

- On your original form, create a datagrid

- Add a tablestyle to the datagird

- Add a columnstyle to the tablestyle

- On your original form, in Design View choose Edit | Select All

- Then choose Edit | Copy

- Go to your new form and paste the datagrid

- If you examine the datagrid that was copied to the new form, you will find that the tablestyle and columnstyle were also copied.


C'ya,
Jim.
 
Back
Top