473,382 Members | 1,124 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,382 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 2195
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: 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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.