473,406 Members | 2,549 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.

Gridview Newvalues are empy after editing

Hi
I'm having a problem getting the newvalues or oldvalues from the RowUpdating
event. I have the following code for the event(See note):
Protected Sub grdPOs_RowUpdating(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles grdPOs.RowUpdating
Dim records(e.NewValues.Count - 1) As DictionaryEntry
Dim entry As DictionaryEntry
Dim DataKeyId as DataKey
try
Dim Itm as New POItem
'Copy the new values into the fields
e.NewValues.CopyTo(records, 0)
''*******************
'Please note, that at this point there is no values in records
''*******************
For Each entry In records
e.NewValues(entry.Key) = Server.HtmlEncode(entry.Value.ToString())
Next
DataKeyId = grdPOs.DataKeys(e.RowIndex )
Itm.POId = DataKeyId("ItemId")
Itm.CatalogNumber = DataKeyId("CatalogId")
Itm.Description = DataKeyId("ItemDescription")
Itm.Qty = DataKeyId("Qty")
Itm.UnitPrice = DataKeyId("UnitPrice")
Itm.Page = DataKeyId("Page")
dim b as Boolean = Utilities.RowUpdating( Itm)
grdPOs.EditIndex = -1
BindData(pUserId)
Catch ex As Exception
msgbox("Error in POAdminEditor.grdPOs_RowUpdating: " & ex.Message )
End Try
End Sub

I use the following function to Bind the grid:
Private sub BindGrid(poOrderid as Integer )
try
'load the data and return a DataTable
Dim dt as DataTable = Utilities.BindGrid(poOrderid)
'Set the datasource
grdPOs.DataSource = dt
grdPOs.DataBind
Catch ex As Exception
msgbox("Error in POAdminEditor.BindGrid: " & ex.Message )
Finally
End Try
End Sub

I can't seem to find a solution in current posts, so I'm hoping someone can
help. Thank you much.
Michael
Apr 13 '06 #1
0 1210

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

Similar topics

5
by: Mark Olbert | last post by:
I ran into a situation this morning where the RowUpdating event of a GridView kept insisting there were no entries in either the OldValues or NewValues dictionaries. The GridView is bound to a...
0
by: lupina | last post by:
Hi I'm trying to read values from editing row. I attempt to use : protected void GridViewWymagania_RowUpdating(object sender, GridViewUpdateEventArgs e) { string s = e.NewValues; .... }
3
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
3
by: pblack9455 | last post by:
I have a simple requirement to bind a small ArrayList of (ItemLine) Objects to a GridView control. The Gridview renders on the page and allows me to click update/edit buttons...however the data...
4
by: tim.cavins | last post by:
I have a GridView populated by an ObjectDataSource. I am having issues passing the parameters to the objectdatasource. I have verified that the method is being called but none of the parameters...
4
by: anniebai | last post by:
Please help me with writing a RowUpdating function in C#, I don't know how to grab the current field's value and also get the old value for one of keys (which is ProjectName for editing) of the...
0
by: lightgram | last post by:
Hello I am having problems extracting the OldValues collection from the RowUpdating event in my GridView. Every time I access this I am getting the values from the NewValues collection in...
6
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have a gridview control with a template column that has a textbox and when the control is bound to the datasource the textbox is filled ok. I then change what is in the textbox in the gridview...
11
by: SAL | last post by:
Hello, I have a Gridview control (.net 2.0) that I'm having trouble getting the Update button to fire any kind of event or preforming the update. The datatable is based on a join so I don't know...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.