can anyone do help..?
i really need help on this, here i have two forms [form1 & form2]. I have created datagridview(DGV) in each forms. Now i need to transfer/copy
Declare Form1's DGV as Public instead of private and do the following in Form2 :
Declare the following variable :
System.Windows.Forms.Form f = System.Windows.Forms.Application.OpenForms["Form1"];
.
Do the Following changes in your program:
private void button1_Click (object sender, EventArgs e)
{
try
{
if (dataGridView1.RowCount != 0)
{
foreach (DataGridViewRow row in dataGridView1.SelectedRows)
{
((Form1)f).dataGridView1.Rows.Add(row);
}
}
else
{
MessageBox.Show("There is no data to export, please verify..!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
catch { } }