|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
TextBox ValueI 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 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 elton_w***@hotmail.com >-----Original Message----- click on button >I have TextBox column in datagrid. >I would like to update database with values when user Show quoteHide quote >(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 > > >. > Thank you for help!
I don't understand the answer. I don't do nothing to grid before button_click event. Simon Show quoteHide quote "Elton W" <anonym***@discussions.microsoft.com> wrote in message news:178b01c5491d$7178d270$a401280a@phx.gbl... > 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 > elton_w***@hotmail.com > > >>-----Original Message----- >>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 >> >> >>. >> 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 Show quoteHide quote >-----Original Message----- >Thank you for help! >I don't understand the answer. I don't do nothing to grid before >button_click event. > >Simon > >"Elton W" <anonym***@discussions.microsoft.com> wrote in message >news:178b01c5491d$7178d270$a401280a@phx.gbl... >> 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 >> elton_w***@hotmail.com >> >> >>>-----Original Message----- >>>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 >>> >>> >>>. >>> > > >. >
Paging with Datagrid Control
Change/read value from control in EditItemTemplate how can I get the DataKeyField MessageBox not showing before Response.Redirect ItemDataBound Slow datagrid on postback ItemCreated question Datagrid column formatting how to use hyper columns in datagrid Error Message: FindControl requires that controls have unique IDs. |
|||||||||||||||||||||||