hey guys....question changes now as i already found the solution of this.
Now my problem is :
When i select those rows from gridview control in the dynamic form., and click on submit button
I want to add those selected rows to another gridview that is in the parent form.
here is the code i tried :
private void btnsubmit_Click(object sender, EventArgs e)
{
try
{
for (int i = 0; i < dgvorders.Rows.Count; i++)
{
if (dgvorders.Rows[i].Cells["orderstatus"].Value.ToString() == "True")
{
masterdatagrid.Rows.Add(dgvorders.Rows[i]);
}
else { }
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error on Submit");
}
Orders.Close();
}
it gives me the exception:
" Rows cannot be programmatically added to the DataGridView's rows collection when the control is data-bound."
Help me out guys... :confused:
Ashutosh Jain.