DataGridView - Determine if a row has been edited

G

Guest

I have a Datagridview.
I only edit couple of columns.
No new rows are added.
I need to know the count of "rows" that were modified.
how do I acheive this?
 
G

Guest

You might want to update and store a counter variable in the ViewState or the
Session upon each successful update (which marks an Edit).

For example if you were using SqlDataSource object with your GridView then
you might handle the SqlDataSource.Updated event:

Protected Sub SqlDataSource_Updated(sender As Object, e As
SqlDataSourceStatusEventArgs)
If e.AffectedRows > 0 Then
dim iCounter as Integer
If Not ViewState("RecordsEditedCounter") Is Nothing Then
iCounter= ViewState("RecordsEditedCounter") + 1
Else
iCounter = 1
End If
ViewState("RecordsEditedCounter")= iCounter
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top