472,127 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

Dirty value of datagridview cell

How do I the value of a cell in a datagridview, before it is updated?

I wish to validate the "visible" value, not the actual value (cell/row
hasn't been updated yet).
Thanks in advance.

/Snedker
Mar 22 '06 #1
1 7551
Hi,

Use the cell validating event

Private Sub DataGridView1_CellValidating(ByVal sender As Object, ByVal e
As System.Windows.Forms.DataGridViewCellValidatingEve ntArgs) Handles
DataGridView1.CellValidating
Dim strOld As String = DataGridView1.Item(e.ColumnIndex,
e.RowIndex).Value.ToString
Dim strNew As String = e.FormattedValue.ToString

Trace.WriteLine(String.Format("Old Value {0} {1}New Value {2}",
strOld, ControlChars.NewLine, strNew))
End Sub

Ken
--------------------
"Morten Snedker" <morten_spammenot_ATdbconsult.dk> wrote in message
news:di********************************@4ax.com...
How do I the value of a cell in a datagridview, before it is updated?

I wish to validate the "visible" value, not the actual value (cell/row
hasn't been updated yet).
Thanks in advance.

/Snedker

Mar 23 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Marc | last post: by
2 posts views Thread by Claudia Fong | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.