TextBox Value

Discussion in 'ASP .Net Datagrid Control' started by Simon Abolnar, Apr 24, 2005.

  1. 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
     
    Simon Abolnar, Apr 24, 2005
    #1
    1. Advertising

  2. Simon Abolnar

    Elton W Guest

    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



    >-----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
    >
    >
    >.
    >
     
    Elton W, Apr 24, 2005
    #2
    1. Advertising

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

    Simon

    "Elton W" <> wrote in message
    news:178b01c5491d$7178d270$...
    > 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
    >
    >
    >
    >>-----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
    >>
    >>
    >>.
    >>
     
    Simon Abolnar, Apr 25, 2005
    #3
  4. Simon Abolnar

    Elton W Guest

    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


    >-----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" <> wrote in

    message
    >news:178b01c5491d$7178d270$...
    >> 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
    >>
    >>
    >>
    >>>-----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
    >>>
    >>>
    >>>.
    >>>

    >
    >
    >.
    >
     
    Elton W, Apr 26, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. S. Justin Gengo
    Replies:
    0
    Views:
    553
    S. Justin Gengo
    Jul 16, 2003
  2. =?Utf-8?B?QW5hY2hvc3RpYw==?=

    RE: Textbox postback putting value,value

    =?Utf-8?B?QW5hY2hvc3RpYw==?=, Jun 18, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    642
    =?Utf-8?B?S2VpdGggRG9yYW4=?=
    Jun 21, 2004
  3. AGSHAR
    Replies:
    1
    Views:
    598
    AGSHAR
    May 31, 2008
  4. ErwinP
    Replies:
    1
    Views:
    769
    ErwinP
    Aug 19, 2005
  5. Steve
    Replies:
    4
    Views:
    226
    Steve
    Feb 7, 2006
Loading...

Share This Page