OnTextChanged in datagrid not working

Discussion in 'ASP .Net Web Controls' started by Eidolon, May 19, 2004.

  1. Eidolon

    Eidolon Guest

    HELP!

    I have a datagrid, and there are several textboxes in each row with an
    ontextchanged attribute pointing to a server-side function. All well and
    good.
    Now that part that baffles me.......

    In the first 40% of the rows, the textboxes dont work, but in the last rows
    they do. For example, when i load the page, i have 12 rows, only the
    textboxes in the last 5 rows actually fire OnTextChanged though. However all
    of them DO perform a postback. Just the first ones never get around to
    calling the OnChanged method i have.

    Given a textBox with a (simplified) id of "myBox" I have checked the values
    of
    Request("myBox") and
    CType(Me.FindControl("myBox"),TextBox).Text
    and they ARE different. so the server does know that the value changed, but
    for whatever reason, it refuses to fire the change event for the first 40%
    rows.

    Any ideas???
    THANKS in advance, its driving me BaTtY!
    Eidolon, May 19, 2004
    #1
    1. Advertising

  2. Hi

    Are you really doing a postback on each change?
    I would rather use onblur="if(this.value!=this.defaultValue){
    if(doStoreIt(this.name,this.value)) this.defaultValue=thisValue">
    Where doStore would return true/false

    And instead of postback I would use webservices behaviour or a hidden iframe
    to
    store the changes

    More info:
    http://msdn.microsoft.com/library/d...hor/dhtml/reference/dhtml_reference_entry.asp
    http://msdn.microsoft.com/downloads...rnet/behaviors/library/webservice/default.asp

    --
    Best Regards
    Vidar Petursson
    ==============================
    Microsoft Scripting MVP
    http://www.microsoft.com/technet/scriptcenter
    ==============================
    "Eidolon" <> wrote in message
    news:...
    > HELP!
    >
    > I have a datagrid, and there are several textboxes in each row with an
    > ontextchanged attribute pointing to a server-side function. All well and
    > good.
    > Now that part that baffles me.......
    >
    > In the first 40% of the rows, the textboxes dont work, but in the last
    > rows
    > they do. For example, when i load the page, i have 12 rows, only the
    > textboxes in the last 5 rows actually fire OnTextChanged though. However
    > all
    > of them DO perform a postback. Just the first ones never get around to
    > calling the OnChanged method i have.
    >
    > Given a textBox with a (simplified) id of "myBox" I have checked the
    > values
    > of
    > Request("myBox") and
    > CType(Me.FindControl("myBox"),TextBox).Text
    > and they ARE different. so the server does know that the value changed,
    > but
    > for whatever reason, it refuses to fire the change event for the first 40%
    > rows.
    >
    > Any ideas???
    > THANKS in advance, its driving me BaTtY!
    >
    >
    Vidar Petursson, May 20, 2004
    #2
    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. Henri
    Replies:
    6
    Views:
    740
    Henri
    Aug 6, 2004
  2. =?Utf-8?B?TmVpbA==?=

    OnTextChanged not firing??

    =?Utf-8?B?TmVpbA==?=, Oct 5, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    4,251
    =?Utf-8?B?TWFyeUE=?=
    Aug 29, 2005
  3. onTextChanged not firing

    , Feb 1, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    14,373
    =?Utf-8?B?c2FyYQ==?=
    Feb 2, 2005
  4. Derek Mendez

    Datagrid Setting Focus and "ontextchanged"

    Derek Mendez, Apr 14, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    11
    Views:
    297
    Jeffrey Tan[MSFT]
    Apr 28, 2004
  5. kj

    OnTextChanged not working

    kj, May 15, 2007, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    617
    Peter
    May 16, 2007
Loading...

Share This Page