Databinding and order of events

R

Rex the Strange

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
 
R

Rex the Strange

Rex said:
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#)
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top