By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,669 Members | 2,546 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,669 IT Pros & Developers. It's quick & easy.

Dropdown boxes in my datalist control

P: n/a
Hi,

I have a datalist that contains a series of thumbnails. I am
in the process of paging this datalist so that only 20 images
are displayed at a time. Each image has associated with
it a pair of dropdown boxes. The user selects theor choices
from the dropdown boxes and then moves to the next
series of 20 images. The postbackURL of the button
click contains the information regarding the next page to
display.

Now, I want to be able to capture the users selections
from the dropdown boxes associated with each thumbnail
before the next page of thumbnails is bound to the datalist
and then bind the next set of records from the datasource
to the datalist.

Does anyone have any ideas which event I should write
my code in to determine which dropdown boxes have had
their values changed before the databinding of the next
images occurs?

Many thanks,

Jason.

Jul 18 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Jason,

There are two ways you could do this. You could write a "CheckDropdowns"
routine that is called from pageload (first check that the datalist already
exists and is populated). In the CheckDropdowns subroutine you would loop
through each datalist item, get the dropdown out of the item and check it's
value.

Another way would be to create an selecteditemchanged event handler for the
dropdown itself (I'm assuming you added the drop downs dynamically). If you
didn't add the dropdowns dynamically they should already have their own
selecteditemchanged event already hooked up. Once you hook up this event to
the dropdowns they will fire the event on their own. This would be the
preferred method because the event will only fire for a drop down that has
been changed. The following article does this but uses a datagrid; it should
be easily convertible for your uses:
http://www.odetocode.com/Articles/231.aspx
Regards,

--
S. Justin Gengo
Web Developer / Programmer

Free code library:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Jason James" <ja***@dive-master.orgwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
Hi,

I have a datalist that contains a series of thumbnails. I am
in the process of paging this datalist so that only 20 images
are displayed at a time. Each image has associated with
it a pair of dropdown boxes. The user selects theor choices
from the dropdown boxes and then moves to the next
series of 20 images. The postbackURL of the button
click contains the information regarding the next page to
display.

Now, I want to be able to capture the users selections
from the dropdown boxes associated with each thumbnail
before the next page of thumbnails is bound to the datalist
and then bind the next set of records from the datasource
to the datalist.

Does anyone have any ideas which event I should write
my code in to determine which dropdown boxes have had
their values changed before the databinding of the next
images occurs?

Many thanks,

Jason.

Jul 18 '06 #2

P: n/a
Justin,

I am scrolling up and down a (longish) datalist and didn't want the
autopostback of the dropdownlist controls to take me to the top of the
datalist each time, plus the postback can be annoying. I would like to
process all of the dropdownlist controls in one go just prior to the
next page of records being loaded.

Any other thoughts?

Jason.

Jul 18 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.