public void getGvDetailsIntoTable1() { try { int x = newDataGridView1.Rows.Count; for (int i = 0; i <=x-1; i++) { QuotGridDetails1.Rows[i]["QuotationId"] = txtQuotationId.Text.Trim().ToString(); QuotGridDetails1.Rows[i]["QuotationDetailsId"] = dGridDetails.Rows[i].Cells["QuotationDetailsId"].Value; QuotGridDetails1.Rows[i]["ItemDescription1"] = dGridDetails.Rows[i].Cells["ItemDescription1"].Value; QuotGridDetails1.Rows[i]["Range1"] = dGridDetails.Rows[i].Cells["Range1"].Value; QuotGridDetails1.Rows[i]["LeastCount1"] = dGridDetails.Rows[i].Cells["LeastCount1"].Value; } } catch (Exception ee) { MessageBox.Show(ee.Message); } }
There is no row at Position 0
if (newDataGridView1.Rows.Length > 0) { }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)