Databinding and order of events

Discussion in 'ASP .Net' started by Rex the Strange, Nov 17, 2006.

  1. I'm having a problem here and am looking for the answer. I have two
    listboxes. One is a dropdown and the other is a simple list of items
    which is databound . I want to be able to allow the user to change the
    value in the dropdown which would, in turn, change the values in the
    list.

    So, I create a background routine to change the sql accordingly. Create
    routine to respond to the event of the dropdown changing values. Set
    autopostback to true. When can I change my sql statement? It seems to
    be either before the onselectedindexchanged event fires or, if on the
    databinding event of the list, it doesn't fire at all after the first
    retrieval.

    I'm sure this is a common thing. Please, how is it done?

    tia,
    rts
     
    Rex the Strange, Nov 17, 2006
    #1
    1. Advertising

  2. Rex the Strange wrote:
    > I'm having a problem here and am looking for the answer. I have two
    > listboxes. One is a dropdown and the other is a simple list of items
    > which is databound . I want to be able to allow the user to change the
    > value in the dropdown which would, in turn, change the values in the
    > list.
    >
    > So, I create a background routine to change the sql accordingly. Create
    > routine to respond to the event of the dropdown changing values. Set
    > autopostback to true. When can I change my sql statement? It seems to
    > be either before the onselectedindexchanged event fires or, if on the
    > databinding event of the list, it doesn't fire at all after the first
    > retrieval.
    >
    > I'm sure this is a common thing. Please, how is it done?
    >
    > tia,
    > rts



    Never mind. I just worked it out. You need to actually call the binding
    method manually from the onselectedindexchanged event handler by
    specifying:

    textboxname.DataBind (); (in C#)
     
    Rex the Strange, Nov 17, 2006
    #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. =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=

    order of events - dynamic checkbox events

    =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=, Aug 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    566
    =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=
    Aug 17, 2005
  2. Nathan Sokalski

    Order of events, databinding, and UserControls

    Nathan Sokalski, May 21, 2006, in forum: ASP .Net
    Replies:
    9
    Views:
    462
    Nathan Sokalski
    May 23, 2006
  3. Replies:
    0
    Views:
    404
  4. Nathan Sokalski

    Order of events, databinding, and UserControls

    Nathan Sokalski, May 21, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    8
    Views:
    145
    Nathan Sokalski
    May 23, 2006
  5. Nathan Sokalski

    Order of events, databinding, and UserControls

    Nathan Sokalski, May 21, 2006, in forum: ASP .Net Web Controls
    Replies:
    8
    Views:
    160
    Nathan Sokalski
    May 23, 2006
Loading...

Share This Page