Click here to Skip to main content
11,437,002 members (38,406 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C#3.0
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.
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 11-Nov-12 20:43pm
Edited 11-Nov-12 20:45pm
Adersh Ram at 12-Nov-12 4:06am

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

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


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

Advertise | Privacy | Mobile
Web01 | 2.8.150428.2 | Last Updated 13 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100