473,406 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Get OldValue of bound field

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).Tex t

'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
May 2 '07 #1
1 1324
On May 2, 10:56 pm, "David C" <dlch...@lifetimeinc.comwrote:
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).Tex t

'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

May 3 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Andi Plotsky | last post by:
I am running some code to validate the entry made into a form called NumberOfSamples. If validation fails, then I want to revert back to the old value. I keep getting an error msg that says: ...
2
by: Megan | last post by:
Hi everybody- I have 2 tables, Hearings and Rulings. Both have primary keys called, CaseID, that are autonumbers. I don't want both tables to have the same autonumber. For example, if Hearings...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
5
by: Dugo | last post by:
In Access 2003, I have a form (continuous form view) with several text boxes. The text boxes are not bound to a table since the layout of the form differs greatly from the structure of the...
1
by: gazelle04 | last post by:
I have these on BeforeUpdate event of a control If Me.txtAddress.Value <> Me.txtAddress.OldValue Then Me.txtGenInfo_UpdatedOn = Now Me.txtGenInfo_UpdatedBy = fOSUserName ...
2
by: Keith Wilby | last post by:
In A2k3 is it possible to determine if the OldValue property for a check box exists using code? Thanks. Keith.
8
by: Avi | last post by:
Hi all, I'm using string Replace(string oldValue, string newValue) and would like it to replace only full words that matches oldValue and not when oldValue is a substring of a larger word. ...
0
by: Mike | last post by:
So here's the situation (.NET 2.0 btw): I have a form, and on this form is a textbox among many other databound controls. The textbox is bound to a field in a data table via the Text property. ...
1
by: Allen Browne | last post by:
Testing if the new value is different from the old one avoids giving the message in these cases: a) It's a new record (so there was no old value.) b) No customer was specified previously (so the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.