Dear All,
Please need your support i am trying to update datagriviwe from another form textbox but cannot please need your support.
Below for you refrence.

private void btntupdate_modify_Click(object sender, EventArgs e)
{
try
{
POS form1 = new POS();
DataGridView Main_dg = (DataGridView)form1.Controls["dataGridView1"];
for (int i = 0; i < Main_dg.Rows.Count; i++)
{
Main_dg.Rows[i].Cells[2].Value = txtupdate_grampcs.Text;
Main_dg.Rows[i].Cells[3].Value = txtupdate_unitprice.Text;
Main_dg.Rows[i].Cells[4].Value = txtupdate_total.Text;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}