TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Hector Hugo Alpizar Cesena
1.3k
427
251.2k
How to pass the DataGridView object to other DataGridView object?
Apr 16 2010 7:16 PM
I have to forms, in the first form appers the data grid where I put the data inside. Then in that form I press a boton, and a second form appers with a DataGridView with the same info that I wrote on the first form.
I pass a DataGridview object on the second form constructor but, the info from the first gridview is not showing.
Form 1 source code
public
partial
class
Form1
:
Form
{
public
Form1()
{
InitializeComponent();
}
private
void
button1_Click(
object
sender,
EventArgs
e)
{
new
Form2
(dataGridView1).Show();
}
}
Form 2 source code
public
partial
class
Form2
:
Form
{
public
Form2()
{
InitializeComponent();
}
public
Form2(
DataGridView
dataGridView)
{
InitializeComponent();
this
.dataGridView1.DataSource = dataGridView.DataSource; //Not working
this
.dataGridView1 = dataGridView; //Not Working
}
}
Reply
Answers (
4
)
Windows Forms Application::Run confusion
edit print preview