473,320 Members | 2,158 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,320 software developers and data experts.

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 2192
I've tried with and without. The data needs to be loaded on the IsPostBack
and the !IsPostBack
Brett
"Rakesh Rajan" <Ra*********@discussions.microsoft.com> wrote in message
news:A8**********************************@microsof t.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.com> wrote in message
news:ch**********@hercules.btinternet.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.com> wrote in message
news:ch**********@hercules.btinternet.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
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)...
1
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...
4
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 & "', '" &...
1
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...
4
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...
5
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....
9
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...
23
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...
2
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.