Datagrid view rows repeat data in all rows
hi every body i have a strange problem in my grid view when i fill my first row with data and move to the second row and after edit the second row and leave the row the data changed to the same as the previous row and so on all row which is edit change to the previous row how can i solve this problem this problem happened when i move with table enter arrows of keyboard

Gowtham KRank #65 · 26.5K reputationPosted May 29, 2015, 2:42 AM EDT
alaa157 reputationPosted May 29, 2015, 3:21 AM EDT
if (dataGridView1.Rows[e.RowIndex].Cells[1].Value != null)
{
string cellValue = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
if (!string.IsNullOrEmpty(cellValue))
{
_bar = cellValue;
PopulateColumns();
dataGridView1.Rows[e.RowIndex].Cells[2].Value = _proname;
dataGridView1.Rows[e.RowIndex].Cells[3].Value = _price;
dataGridView1.Rows[e.RowIndex].Cells[4].Value = _unit;
}
}
i use PopulateColumns(); to access data from data table and pass it to the grid view where it equal dataGridView1.Rows[e.RowIndex].Cells[1].Value . when i use break-point it works correct if i stop break point it repeat the same data in each row despite the value of dataGridView1.Rows[e.RowIndex].Cells[1].Value is not the same ?
Gowtham KRank #65 · 26.5K reputationPosted May 29, 2015, 5:08 AM EDT
Gowtham KRank #65 · 26.5K reputationPosted May 29, 2015, 5:19 AM EDT
alaa157 reputationPosted May 29, 2015, 9:22 AM EDT
Gowtham KRank #65 · 26.5K reputationPosted May 30, 2015, 4:07 AM EDT