Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hello Everybody,

While loading the form i am retrieving values from database and showing in datagridview . when i click save,all the values are being updated .It is working fine.But i have many rows so performance is slow.
This is code i am using and it is working fine.
C#
foreach (DataGridViewRow examinationlistrow in dgvExamination.Rows)
            {
                string _examinid = examinationlistrow.Cells[0].Value.ToString();
                string _examinvalue = examinationlistrow.Cells[3].Value.ToString();
                UpdateListItem(mrid, ic, _examinid, _examinvalue);
            }


But i want to update only changed values of the datagridview.
Posted
Updated 11-Nov-12 19:45pm
v2
Comments
Adersh Ram 12-Nov-12 4:06am    
Hi,

I suggest add a new column in datagridview Like "Action", when editing a column
you change the Action column value to "Edit"(you can use Datagridview cellendedit event).

When inserting time you put a condition
IF (examinationlistrow.Cells["Action"].Value.ToString() == "Edit")
{

}

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900