473,796 Members | 2,839 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GridView RowUpdating(... ) event. How to get the updated row values?

Hi,

I'm using the RowUpdating() event of an updatable GridView. I need to
see the values of the columns in the updated row. There has got to be
a way to do this!

Any suggestions?

Thanks in advance!

Steve

Sep 21 '07 #1
1 9566
The RowUpdating method has a variable that is of type GridViewUpdateE ventArgs
and has two properties that may interest you: OldValues and NewValues.

For an example, if you wanted to see the values onUpdating, you could place
a ListBox control on your page and fill it with this method:

protected void gv_RowUpdating( object sender, GridViewUpdateE ventArgs e)
{
ListBox1.Items. Clear();
for (int i = 0; i < e.NewValues.Cou nt; i++)
{
ListBox1.Items. Add(e.NewValues[i].ToString());
}
}

HTH.

-dl

--
David R. Longnecker
http://blog.tiredstudent.com
Hi,

I'm using the RowUpdating() event of an updatable GridView. I need to
see the values of the columns in the updated row. There has got to be
a way to do this!

Any suggestions?

Thanks in advance!

Steve

Sep 21 '07 #2

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

Similar topics

7
3155
by: Programatix | last post by:
Hi, I'm working on a WebService project. I'm trying to validate data before they are updated to the database by handling the RowUpdating event for a SqlDataAdapter. The data being handled has DataRelation which is related to another DataTable. As for that, I also need to retrieve the DataRelation from the current row being updated. I wrote a code which look something like this, Dim relation As DataRelation
0
1837
by: Newasps | last post by:
Hi guys, I have a problem with UpdateCommand Event. In tihs event Ä°'m creating required controls to get that controls' values and also get them. But when I try to get updated values I'm getting the first values for each control. Please help me. Thanks for any help. Bye Ozer And here's my code: Imports System Imports System.Data Imports System.Data.OleDb
3
5590
by: | last post by:
Hello, I am trying to get add a product to a cart from a gridview control when a button in the gridview is clicked. I have a book on how to do this in asp.net 2.0 but it is done by specifying the "DataTextField" as the productID of the product that I want to add. This works but the button displays the productID as the text instead of "Add to Cart". What is the best way to get this to work?
3
9807
by: slemen | last post by:
The controls (textboxes) in the gridview row being updated have the old, pre user updated values in the RowUpdating event. Does anyone have an idea why? Thank you, Scott
1
9015
by: s.bussing | last post by:
Hi, I have been struggling with the GridView the whole day, but can not get this solved. The rowupdating event in my Gridview doesn't give me the new values only the old ones. In my GridView I do not use a DataSourceObject and can therefore not use e.NewValues or e.OldValues The columns used are template columns
1
1556
by: anniec | last post by:
I am trying to access a text box in a grid that the user has changed. I tried a bunch of stuff in the RowUpdating event. None of them is giving me the value in the text box. 'doesn't work Dim test As String = GridView1.Rows(0).Cells(4).Text ' This doesn't show the value in the text box either. Dim test As Integer = GridView1.Rows(e.RowIndex).Cells(4).Text
9
26928
by: John007 | last post by:
I am using a SQLDataSource to populate my gridview in ASP.Net 2.0. When I hit Edit, the textboxes appear and I am able to edit my values. When I hit Update, the changes are not saved, and there is no error message. I put a breakpoint on the RowUpdating event handler and found that the event is not fired. Right now, I have not written code for the Update event. I am just wondering why the event is not firing. Here Person_ID is the primary key....
1
1933
by: Joe Blauth | last post by:
Hi all, I was running into a problem with a gridview under ASP.net. What I am trying to do is binding the DataSource dynamically in a way that enables me to edit the rows in the Gridview. This is basically running alright except of the fact that when I switch to "edit" in a row inside the Gridview and edit the value and hit "update" I don't find a way to retrieve the changed values. Here's what I did: I placed a DataGrid control on my...
0
2508
by: E. Kwong | last post by:
In a Gridview control, I have several BoundFields, and also a couple of TemplateFields. In the Rowupdating event, I try to retrieve one of the BoundFields (i.e. 4th column of the Gridview control) for comparision purpose. However; I got null string everytime. On the other hand, I'm able to retrieve the dropdownbox value in the TemplateField. I would like to know what I did wrong with the BoundField. Thanks. Code fragment:
0
9525
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10221
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10169
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5569
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.