public void AddOrUpdateNewRecord(string name, DataGridViewCellEventArgs e)
{
/*
//--We need to count the index of the current datagridview if the row index
is greater then the data in the list of data
*/
if (e.RowIndex + 1 > chartDetailList.Count)
{
//insert the data...
string nameValue = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
insertNewDataFromDGV(nameValue);
}
else
{
//--Update the data
string chartIDValue = chartDetailList[e.RowIndex].chartID;
string nameValue = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
UpdateNewDataFromDGV(nameValue, chartIDValue);
}
}