473,387 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Dropdown boxes in my datalist control

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
2 3603
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dmitry Korolyov [MVP] | last post by:
Is that possible? In other words, I want a dropdown list (and other list-type controls) which appears in edit more of a templated column to be populated with data at the run time. An attempt to do so...
0
by: Mark | last post by:
Hi, I have a datalist that contains a textbox as well as a dropdown list. For each single row in the datalist the associated dropdown list can have at least one value What I would like to be...
2
by: DotNetJunkies User | last post by:
hi,, im trying to work out what code is needed for the below problem about databinding a dropdown list and having actual datalist items as value "0" ie 'please select' can anyone tell me how to...
10
by: Bharat | last post by:
Hi Folks, Suppose I have two link button on a page (say lnkBtn1 and lnkBtn2). On the click event of the lnkbtn1 I have to add a dynamically created control. And On the click event of the lnkBtn2 I...
2
by: Cheryl | last post by:
I have grabbed a menu from a javascript site ( http://www.dynamicdrive.com/dynamicindex1/topmen3/index.htm ) and added to my page. The problem is however the dropdown comes down on top of text and...
6
by: tshad | last post by:
I need to get to a status label I have on my footer section of my datalist. There is no event happening that would go to the footer. I am just doing some processing and want to update the label...
2
by: Hans Merkl | last post by:
Hi, I am trying to use a user control as EditItemTemplate in a DataList. It loads fine but I can't figure out how to bind to the data of the DataList. Here is what I have got so far: ...
5
by: Gil | last post by:
Is there a way to tell if a combbox is in dropdown mode. I tried and if statement combobox.dropdown = true but i get an error. dropwndown function doesnt store if its true or false what i am...
8
by: Wingot | last post by:
Hey, I have a program I am trying to write using Visual C#, SQL Server 2005/2008, and Visual Studio 2008, and one part of it includes a Schema called Client. Inside this schema, three tables...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.