473,721 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datagrid UpdateCommand not taking new value

Hi,

I'm having trouble with the datagrid update command.

I have a datagrid called grid that poulates itself with data in the page
load event.

When I click the edit button it takes me into edit mode no pronlem, however
when I change the data in the edit cell it is not picking up the newly typed
value, it passes back the original value. eg, the orgincal value is
"hello", I change it to "goodbye" but it passes back "hello" to my update
procedure.

Any ideas why?

Just to add a bit more confusion, if I don't load and bind the data to the
grid in the Page_Load event, but instead do it through a link button AFTER
the page has been loaded it works fine!!??
Nov 16 '05 #1
3 2211
I've tried with and without. The data needs to be loaded on the IsPostBack
and the !IsPostBack
Brett
"Rakesh Rajan" <Ra*********@di scussions.micro soft.com> wrote in message
news:A8******** *************** ***********@mic rosoft.com...
Hi Brett,

Are you handling the IsPostBack condition during PageLoad properly?

- Rakesh

"Brett Hargreaves" wrote:
Hi,

I'm having trouble with the datagrid update command.

I have a datagrid called grid that poulates itself with data in the page
load event.

When I click the edit button it takes me into edit mode no pronlem, however when I change the data in the edit cell it is not picking up the newly typed value, it passes back the original value. eg, the orgincal value is
"hello", I change it to "goodbye" but it passes back "hello" to my update procedure.

Any ideas why?

Just to add a bit more confusion, if I don't load and bind the data to the grid in the Page_Load event, but instead do it through a link button AFTER the page has been loaded it works fine!!??

Nov 16 '05 #2
Hi,

Any ideas why?

I think that it's the usual behavior, see it like if the grid has two
status, and it;s your responsability to keep both of them in sync. when you
change a row you have to persist that info in the datasource ( datagrid,
array, collection, etc ) and then rebind the grid.

"Brett Hargreaves" <br************ **@btinternet.c om> wrote in message
news:ch******** **@hercules.bti nternet.com... Hi,

I'm having trouble with the datagrid update command.

I have a datagrid called grid that poulates itself with data in the page
load event.

When I click the edit button it takes me into edit mode no pronlem, however when I change the data in the edit cell it is not picking up the newly typed value, it passes back the original value. eg, the orgincal value is
"hello", I change it to "goodbye" but it passes back "hello" to my update
procedure.
Just to add a bit more confusion, if I don't load and bind the data to the
grid in the Page_Load event, but instead do it through a link button AFTER
the page has been loaded it works fine!!??

Nov 16 '05 #3
I've just found what's casuing the issue, but don't know how to fix the new
issue!

Basically, instead of inplace editing I redirected to a completely new page
that held a textbox control. If I prgramatically fill the textbox control's
Text property with a value (eg from a database using txtPrice.Text =
reader(0)) then I get the same problem, ie when I chaange the text on the
webform it posts back the original data again.

But I didn;t BIND the data to the control, i just set its Text property. It
just dosn;t pick it up when I a change this value and post it back

????
"Brett Hargreaves" <br************ **@btinternet.c om> wrote in message
news:ch******** **@hercules.bti nternet.com...
Hi,

I'm having trouble with the datagrid update command.

I have a datagrid called grid that poulates itself with data in the page
load event.

When I click the edit button it takes me into edit mode no pronlem, however when I change the data in the edit cell it is not picking up the newly typed value, it passes back the original value. eg, the orgincal value is
"hello", I change it to "goodbye" but it passes back "hello" to my update
procedure.

Any ideas why?

Just to add a bit more confusion, if I don't load and bind the data to the
grid in the Page_Load event, but instead do it through a link button AFTER
the page has been loaded it works fine!!??

Nov 16 '05 #4

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

Similar topics

8
1711
by: Brent Burkart | last post by:
My datagrid OnCancelCommand event is not firing. HTML OnCancelCommand="AdminGrid_Cancel" 'Code Behind Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) AdminGrid.EditItemIndex = -1 BindData()
1
4327
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls (watch the layout, some have child controls):
4
3924
by: Paul | last post by:
I sometimes get a timeout error when populating my datagrid, the code is WizardConnection.Open() UpdateCommand.CommandText = "EXECUTE sp_assign_user '" & PhysOffice.SelectedValue & "', '" & Context.User.Identity.Name & "'" UpdateCommand.ExecuteNonQuery()
1
1592
by: MrMike | last post by:
Hi. My application has dozens of datagrids but for some reason an exception occurs when one of them is updated. When a user edits a datagrid row and then clicks 'Update' the following exception occurs: --------------------- "Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: index" --------------------- I've placed breakpoints with the UpdateCommand event, but...
4
3480
by: siaj | last post by:
Hello All, If some one has faced a similar issue.. My datagrid Update command is not getting fired in fact it seems that the no event fires on clicking the update link. Although the cancel and the Edit Commmand are getting fired properly. The One difference I have seen is that in the task bar ..on hovering on the link the javascript for the update link seems different. I dont know if it makes sense..
5
1870
by: Hennie | last post by:
When trying to update a record in an editable datagrid I ran into a few problems. My update procedure is just not working. Can someone please have a look at my code and see what am I doing wrong. I had to set the datagrid's DataKeyField to MailSubscriberID manually since vs does not do it automatically. Thanks
9
2721
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the code: <script runat="server"> Dim sqlConn As New SqlConnection(".....") Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) If Not (Page.IsPostBack) Then FillDataGrid()
23
1952
by: tanya2001 | last post by:
hi all.. I am trying to update my datagrid in my webform...but its not getting updated..though in the database it removing the <null> and inserting a blank field....its not taking the input which m typing...can sombody plz help me out in this..i need help urgently I am posting the code in vb.net for the webform as well as html Protected Sub DataGrid1_UpdateCommand(ByVal source As Object, ByVal e As...
2
2798
by: pozze | last post by:
Hi, I need to display images and other record information retrieved from an SQL 2005 database in a datagrid on a web page. I'm coding in VB .net I have recently changed over from VB ASP and i'm still getting used to .net I can successfully upload images and other data into the SQL Database, I'm currently storing RecordID, File Name, Type of File (mime), File Size, and File Data. I can retreive non binary data to a datagrid but I cannot...
0
8730
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
9367
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9215
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
9131
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
8007
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6669
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4484
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
4753
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2576
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.