469,590 Members | 2,464 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,590 developers. It's quick & easy.

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 2050
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Brent Burkart | last post: by
4 posts views Thread by Paul | last post: by
1 post views Thread by MrMike | last post: by
4 posts views Thread by siaj | last post: by
9 posts views Thread by rn5a | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.