|
-
Feb 9th, 2012, 08:18 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Duplicate Control
Hi all
Wondering if there is a way I can duplicate controls and have them work properly?
basically, i have a datagridview with code in it plus buttons that do various things to it etc etc
ideally, i'd like to be able to have two of these datagridviews on show
So, user presses button, second datagridview shows.
Note that I don't want them to both display the same data - they should both be independetly editable..
Cheers!
-
Feb 9th, 2012, 08:47 AM
#2
Hyperactive Member
Re: Duplicate Control
Why not just create the second datagridview and on form load set:
vbnet Code:
DataGridView2.Visible = False
When the user presses the button:
vbnet Code:
DataGridView2.Visible = True
-
Feb 9th, 2012, 08:56 AM
#3
Thread Starter
Addicted Member
Re: Duplicate Control
Thanks for the reply! . If I were to simply copy and paste the dgv would that create any issues with the code within it? For example I have some code which works depending on the state of the checkbox column etc. would it simply be a case of changing the code to DataGridView 2 instea of DatagridView 1?
Thanks for your help!
-
Feb 9th, 2012, 09:09 AM
#4
Hyperactive Member
Re: Duplicate Control
If you copy the control it will rename itself to DataGridView2 and so all the code for DataGridView1 won't apply to it.
Yes you can just copy the code too, changing each bit to DataGridView2.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|