Get OldValue of bound field

D

David C

Using ASP.Net 2.0 and VS2005. I have a GridView that is bound to an
SqlDataSource and I want to get and hold the previous value of a bound
control on the row I am editing. Below is what I am trying but the
txtOldValue.Text is not getting populated. How can I get this to work
and/or is there a better way? Thanks.
David

Sub SubfilesGridView_RowEditing(ByVal sender As Object, ByVal e As
GridViewEditEventArgs)

' Get the seq# for the row being edited.

' SeqNo is contained in the 2nd column (index 1).


Dim strseqno As String = SubfilesGridView.Rows(e.NewEditIndex).Cells(1).Text

'Put old seqno into form field

txtMsg.Text = ""

If strseqno <> "" Then

e.Cancel = True

txtOldValue.Text = strseqno

Else

'e.Cancel = True

txtOldValue.Text = ""

End If

MultiView1.ActiveViewIndex = 0

End Sub
 
G

Guest

Using ASP.Net 2.0 and VS2005. I have a GridView that is bound to an
SqlDataSource and I want to get and hold the previous value of a bound
control on the row I am editing. Below is what I am trying but the
txtOldValue.Text is not getting populated. How can I get this to work
and/or is there a better way? Thanks.
David

Sub SubfilesGridView_RowEditing(ByVal sender As Object, ByVal e As
GridViewEditEventArgs)

' Get the seq# for the row being edited.

' SeqNo is contained in the 2nd column (index 1).

Dim strseqno As String = SubfilesGridView.Rows(e.NewEditIndex).Cells(1).Text

'Put old seqno into form field

txtMsg.Text = ""

If strseqno <> "" Then

e.Cancel = True

txtOldValue.Text = strseqno

Else

'e.Cancel = True

txtOldValue.Text = ""

End If

MultiView1.ActiveViewIndex = 0

End Sub


get rid of e.Cancel = True
 

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,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top