TextBox Value

S

Simon Abolnar

I have TextBox column in datagrid.
I would like to update database with values when user click on button
(outside datagrid).

Dim cell As TableCell=datagrid.Items(row).Cells(col)
textbox=CType(cell.FindControl("TextBox1"), TextBox)

If user change text of TextBox in one column, command:
textbox.Text

display old value (not entered).
How can I find out changed text.

Thanks for help!

Simon
 
E

Elton W

Hi Simon,

If you rebind the datagrid's data source, the user entered
value is overwrited by data source (old) value. In order
to get user entered value, don't run command

datagrid.DataSource = dataobject

before button_click event.

HTH

Elton Wang
(e-mail address removed)
 
S

Simon Abolnar

Thank you for help!
I don't understand the answer. I don't do nothing to grid before
button_click event.

Simon
 
E

Elton W

Do you only bind datagrid's data source when it's not
postback? If not, when you click button, it re-binds the
datagrid's data source first, then goes to button_click
event.

HTH

Elton
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top