Forum Moderators: open

Message Too Old, No Replies

Problem using using update command with a datagrid

         

Jimmy Turnip

12:11 pm on Mar 11, 2004 (gmt 0)

10+ Year Member



I'm trying to use the update command with a datagrid and referencing the text box to update the field as usual using:

CType(e.Item.Cells(1).Controls(0), TextBox).Text

Problem is this text value is always the original value of the datagrid and never changes to what has been entered into the text box. This is driving me insane. What on earth could be the problem?

Even when I have it just putting the value into a label and not the database as well, it still shows the original datagrid value.

Thanks in advance.

duckhunter

1:16 am on Mar 12, 2004 (gmt 0)

10+ Year Member



Why are you casting it as a Textbox? Why not just reference the cell's text property?

DataGrid1.Items(1).Cells.Item(0).Text()

Jimmy Turnip

11:42 am on Mar 12, 2004 (gmt 0)

10+ Year Member



Thanks for your help. It was actually my own error in the code. I was using a cached dataset in the page_load and then the event handler that was being called afterwards was using that value instead of the text box. Not sure why, but at least I sorted it out.