473,714 Members | 2,500 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

One item dropdowns

Jon
I am using cascading dropdowns, where one dropdown determines the data in
the next, etc...

If a dropdown has only one item in it, the SelectedIndexCh anged event is
never fired, even if you click on the dropdown and "reselect" the single
item. This also happens when there are multiple items in the DD with the
first item. You have to select another list item, then reselect the first
one to have the event fire. I have it set to AutoPostBack, but obviously it
is not in these situations. Is there a way to make the event happen in
these situations.

I tried the following (thinking it would force the user to select the item
and fire the event), but it still selected the single item.

ddTest.DataBind ()
ddTest.Selected Index = -1

Thanks

--
*************** *************** **
Jon Rosenberg
Nov 18 '05 #1
3 1548
Try adding a "-- Select Item --" item to the top of the list. That way,
selecting even the only ONE (other) item in the dropdown causes a
selectedIndex changed event.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"Jon" <ru******@msn.c om> wrote in message
news:10******** *****@corp.supe rnews.com...
I am using cascading dropdowns, where one dropdown determines the data in
the next, etc...

If a dropdown has only one item in it, the SelectedIndexCh anged event is
never fired, even if you click on the dropdown and "reselect" the single
item. This also happens when there are multiple items in the DD with the
first item. You have to select another list item, then reselect the first
one to have the event fire. I have it set to AutoPostBack, but obviously it is not in these situations. Is there a way to make the event happen in
these situations.

I tried the following (thinking it would force the user to select the item
and fire the event), but it still selected the single item.

ddTest.DataBind ()
ddTest.Selected Index = -1

Thanks

--
*************** *************** **
Jon Rosenberg

Nov 18 '05 #2
Jon
Thanks. Not the solution I was hoping for, but it certainly works.
"Kevin Spencer" <ks******@takem pis.com> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
Try adding a "-- Select Item --" item to the top of the list. That way,
selecting even the only ONE (other) item in the dropdown causes a
selectedIndex changed event.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"Jon" <ru******@msn.c om> wrote in message
news:10******** *****@corp.supe rnews.com...
I am using cascading dropdowns, where one dropdown determines the data in
the next, etc...

If a dropdown has only one item in it, the SelectedIndexCh anged event is
never fired, even if you click on the dropdown and "reselect" the single
item. This also happens when there are multiple items in the DD with the
first item. You have to select another list item, then reselect the
first
one to have the event fire. I have it set to AutoPostBack, but obviously

it
is not in these situations. Is there a way to make the event happen in
these situations.

I tried the following (thinking it would force the user to select the
item
and fire the event), but it still selected the single item.

ddTest.DataBind ()
ddTest.Selected Index = -1

Thanks

--
*************** *************** **
Jon Rosenberg


Nov 18 '05 #3
Just thinking about this. Forgive me if this is a silly idea, but here goes.
I get the impression that you don't want the "-- Select Item --" to show in
the dropdown list. I would suggest including it as suggested, but setting
the style atrribute to "visibility : hidden; height:0; width:0"

ME

"Jon" <ru******@msn.c om> wrote in message
news:10******** *****@corp.supe rnews.com...
Thanks. Not the solution I was hoping for, but it certainly works.
"Kevin Spencer" <ks******@takem pis.com> wrote:-
Try adding a "-- Select Item --" item to the top of the list. That way,
selecting even the only ONE (other) item in the dropdown causes a
selectedIndex changed event.
"Jon" <ru******@msn.c om> wrote:-
I am using cascading dropdowns, where one dropdown determines the data in the next, etc...

If a dropdown has only one item in it, the SelectedIndexCh anged event is never fired, even if you click on the dropdown and "reselect" the single item. This also happens when there are multiple items in the DD with the first item. You have to select another list item, then reselect the
first
one to have the event fire. I have it set to AutoPostBack, but
obviously it
is not in these situations. Is there a way to make the event happen in
these situations.

I tried the following (thinking it would force the user to select the
item
and fire the event), but it still selected the single item.

ddTest.DataBind ()
ddTest.Selected Index = -1


--
Martin Eyles
ma**********@NO SPAM.bytronic.c om
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1832
by: Vinay | last post by:
Hi All: I'm having a strange problem with the dropdownlist. Here is what is happening: I have a webform on which I have a whole bunch of controls. The form has 2 dropdownlists. The dropdowns are bound. The items are loaded just fine into the dropdown lists at the time of page load. When I try to select an item from the dropdown list, it always ends up selecting the first item.
9
3266
by: Frances | last post by:
Hi All, * PREMISE * I'm creating an Access form with 150 items subdivided into 20 categories. Multiple categories (and items) can be selected so my user wants checkboxes. All of the options need to be visible at the same time so no dropdowns (combo boxes) and no scrolling lists (list boxes). I will use tabbed sheets with logically grouped categories (and their respective items).
3
1580
by: Damon | last post by:
I am working on a site in which I would like to have two dropdowns that will allow a user to navigate through the administrative pages of the site. The first would allow the user to choose the particular site that they would like to edit. The second would allow the user to select which admin screen they would like to edit. The second dropdown needs to be populated based on the selection in the first one. I want to encapsulate these...
1
1464
by: Andy | last post by:
What I want to do is to populate multiple dropdowns when editing. Presumably... a) I should use a DataReader so that I can get each ResultSet for each dropdown control, and that should cut down round trips to the server. b) I should populate these dropdowns in the DataGrid_EditCommand? What I am having problems with is actually referencing the dropdowns on the template. e.g. I have a dropdown called drpAccessLevels, but I cannot find this...
3
1214
by: Simon Harvey | last post by:
Hi everyone, I keep getting a problem with dropdownlist controls. It sounds really stupid, but my app is screwed as long as this keeps happening. It seems to spontaneously happen and then I cant fix it without rebuilding the whole page from scratch! Not Fun. :-( So whats happening is I have my dropdowns on the page. The user comes along and selects an option, but when the user submits the page,. its as if nothing
6
1746
by: cretaceous | last post by:
Hi I'm a php/mysql developer and struggle when it comes to javascript ! I've looked all over for a solution but am rubbish at adapting javascript I've got two select dropdowns in a form The first picks an item and the second needs to auto update to show which colours that item comes in (I've done it before by resubmitting the page with php via an auto submit - which is ugly) Ok - I've managed to convert all my colours into a multi...
0
1616
by: bogorman | last post by:
Am trying to add a "video" to a webpage which is based on a template containing a javascript menu. The site has hundreds of pages all based on this template and the menu works fine The page can be viewed: www.faith.org.uk/Testindex.html In IE7 it works fine. The video shows and the dropdowns of the menu work correctly. In Mozilla Firefox, although the video works the dropdowns do not show. I have been told that everything works ok in OS...
0
968
by: sbart | last post by:
I am programing in asp.net vb using AjaxToolkit cascadingDropDown. I do not have access to AjaxToolkit cascading dropdown event handlers. I have a series of dropdowns. The selection from one of the dropdowns (call it ddA) triggers the visibility of some of the other dropdowns. Problem is that f the user makes one selection from ddA, makes selections from additonal dropdowns, then goes back and changes the selection in ddA, the selections...
0
9314
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9015
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7953
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6634
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5947
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4725
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3158
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2110
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.