473,324 Members | 2,002 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,324 software developers and data experts.

ddl selectedindexchanged not firing on first item - I'm using a dataset to populate the ddl

Hi

I have a ddl that I have populated with a dataset.
I have 2 items in the ddl.
The first one is '3D' and the second one is 'Spot'.
I have to select Spot - the second item in the ddl and then 3D the first
item in the ddl to get it to fire for 3D.
I have autopostback set to true.
I have heard that I need to put a blank item in the ddl, but not sure how I
would do this with a dataset.
I don't want to put a blank record in the table just to get a blank in the
ddl.
Does anyone know how to solve this problem?

Thanks,
CindyH
Jul 14 '06 #1
5 3248
"Cindy H" <no*****@nowhere.comwrote in
news:#N**************@TK2MSFTNGP03.phx.gbl:
Hi

I have a ddl that I have populated with a dataset.
I have 2 items in the ddl.
The first one is '3D' and the second one is 'Spot'.
I have to select Spot - the second item in the ddl and then 3D the
first item in the ddl to get it to fire for 3D.
I have autopostback set to true.
I have heard that I need to put a blank item in the ddl, but not sure
how I would do this with a dataset.
I don't want to put a blank record in the table just to get a blank in
the ddl.
Does anyone know how to solve this problem?

Thanks,
CindyH

What is it you are attempting to do? I guess I'm kind of confused because
a .selectedindexchanged only fires when the items have changed in the
dropdown... so why would you want the subroutine to run before a user
changed the index?

If you are populated them from a true dataset you could try and append a
blank item onto the dataset after the set has populated... maybe. (I'm
pretty new myself) =)

I'm sure we could figure out a fix for what you need!
Jul 14 '06 #2
Maybe I didn't explain it very well.
I need the ddl to look like this:
item 1 - a blank
item 2 - 3D
item 3 - Spot
My dataset selects some names out of a table and orders it in alphabetic
order, but I need the first item in the ddl to be a blank.
I tried adding this
ddlShoots.Items.Add(" ")

after the bind statement, but it puts the blank item at the bottom instead
of at the top of the ddl.

Thanks,
CindyH

"Zamael" <no*****@gmail.comwrote in message
news:Xn*****************************@63.218.45.254 ...
"Cindy H" <no*****@nowhere.comwrote in
news:#N**************@TK2MSFTNGP03.phx.gbl:
Hi

I have a ddl that I have populated with a dataset.
I have 2 items in the ddl.
The first one is '3D' and the second one is 'Spot'.
I have to select Spot - the second item in the ddl and then 3D the
first item in the ddl to get it to fire for 3D.
I have autopostback set to true.
I have heard that I need to put a blank item in the ddl, but not sure
how I would do this with a dataset.
I don't want to put a blank record in the table just to get a blank in
the ddl.
Does anyone know how to solve this problem?

Thanks,
CindyH

What is it you are attempting to do? I guess I'm kind of confused because
a .selectedindexchanged only fires when the items have changed in the
dropdown... so why would you want the subroutine to run before a user
changed the index?

If you are populated them from a true dataset you could try and append a
blank item onto the dataset after the set has populated... maybe. (I'm
pretty new myself) =)

I'm sure we could figure out a fix for what you need!

Jul 14 '06 #3
"Cindy H" <no*****@nowhere.comwrote in
news:ey**************@TK2MSFTNGP04.phx.gbl:
Maybe I didn't explain it very well.
I need the ddl to look like this:
item 1 - a blank
item 2 - 3D
item 3 - Spot
My dataset selects some names out of a table and orders it in
alphabetic order, but I need the first item in the ddl to be a blank.
I tried adding this
ddlShoots.Items.Add(" ")

after the bind statement, but it puts the blank item at the bottom
instead of at the top of the ddl.

Thanks,
CindyH

"Zamael" <no*****@gmail.comwrote in message
news:Xn*****************************@63.218.45.254 ...
>"Cindy H" <no*****@nowhere.comwrote in
news:#N**************@TK2MSFTNGP03.phx.gbl:
Hi

I have a ddl that I have populated with a dataset.
I have 2 items in the ddl.
The first one is '3D' and the second one is 'Spot'.
I have to select Spot - the second item in the ddl and then 3D the
first item in the ddl to get it to fire for 3D.
I have autopostback set to true.
I have heard that I need to put a blank item in the ddl, but not
sure how I would do this with a dataset.
I don't want to put a blank record in the table just to get a blank
in the ddl.
Does anyone know how to solve this problem?

Thanks,
CindyH


What is it you are attempting to do? I guess I'm kind of confused
because a .selectedindexchanged only fires when the items have
changed in the dropdown... so why would you want the subroutine to
run before a user changed the index?

If you are populated them from a true dataset you could try and
append a blank item onto the dataset after the set has populated...
maybe. (I'm pretty new myself) =)

I'm sure we could figure out a fix for what you need!


Try:
ddlShoots.Items.Insert(0,"")

That "should" put a 0 index item which "should" go at the top... but who
knows!
Jul 14 '06 #4
hey - thank you - that's what I was looking for!

"Zamael" <no*****@gmail.comwrote in message
news:Xn*****************************@63.218.45.254 ...
"Cindy H" <no*****@nowhere.comwrote in
news:ey**************@TK2MSFTNGP04.phx.gbl:
Maybe I didn't explain it very well.
I need the ddl to look like this:
item 1 - a blank
item 2 - 3D
item 3 - Spot
My dataset selects some names out of a table and orders it in
alphabetic order, but I need the first item in the ddl to be a blank.
I tried adding this
ddlShoots.Items.Add(" ")

after the bind statement, but it puts the blank item at the bottom
instead of at the top of the ddl.

Thanks,
CindyH

"Zamael" <no*****@gmail.comwrote in message
news:Xn*****************************@63.218.45.254 ...
"Cindy H" <no*****@nowhere.comwrote in
news:#N**************@TK2MSFTNGP03.phx.gbl:

Hi

I have a ddl that I have populated with a dataset.
I have 2 items in the ddl.
The first one is '3D' and the second one is 'Spot'.
I have to select Spot - the second item in the ddl and then 3D the
first item in the ddl to get it to fire for 3D.
I have autopostback set to true.
I have heard that I need to put a blank item in the ddl, but not
sure how I would do this with a dataset.
I don't want to put a blank record in the table just to get a blank
in the ddl.
Does anyone know how to solve this problem?

Thanks,
CindyH



What is it you are attempting to do? I guess I'm kind of confused
because a .selectedindexchanged only fires when the items have
changed in the dropdown... so why would you want the subroutine to
run before a user changed the index?

If you are populated them from a true dataset you could try and
append a blank item onto the dataset after the set has populated...
maybe. (I'm pretty new myself) =)

I'm sure we could figure out a fix for what you need!

Try:
ddlShoots.Items.Insert(0,"")

That "should" put a 0 index item which "should" go at the top... but who
knows!

Jul 14 '06 #5
You're very welcome :)

"Cindy H" <no*****@nowhere.comwrote in news:#MXmVZ3pGHA.1548
@TK2MSFTNGP04.phx.gbl:
hey - thank you - that's what I was looking for!

"Zamael" <no*****@gmail.comwrote in message
news:Xn*****************************@63.218.45.254 ...
>"Cindy H" <no*****@nowhere.comwrote in
news:ey**************@TK2MSFTNGP04.phx.gbl:
Maybe I didn't explain it very well.
I need the ddl to look like this:
item 1 - a blank
item 2 - 3D
item 3 - Spot
My dataset selects some names out of a table and orders it in
alphabetic order, but I need the first item in the ddl to be a
blank.
I tried adding this
ddlShoots.Items.Add(" ")

after the bind statement, but it puts the blank item at the bottom
instead of at the top of the ddl.

Thanks,
CindyH

"Zamael" <no*****@gmail.comwrote in message
news:Xn*****************************@63.218.45.254 ...
"Cindy H" <no*****@nowhere.comwrote in
news:#N**************@TK2MSFTNGP03.phx.gbl:

Hi

I have a ddl that I have populated with a dataset.
I have 2 items in the ddl.
The first one is '3D' and the second one is 'Spot'.
I have to select Spot - the second item in the ddl and then 3D
the
first item in the ddl to get it to fire for 3D.
I have autopostback set to true.
I have heard that I need to put a blank item in the ddl, but not
sure how I would do this with a dataset.
I don't want to put a blank record in the table just to get a
blank
in the ddl.
Does anyone know how to solve this problem?

Thanks,
CindyH

What is it you are attempting to do? I guess I'm kind of confused
because a .selectedindexchanged only fires when the items have
changed in the dropdown... so why would you want the subroutine to
run before a user changed the index?

If you are populated them from a true dataset you could try and
append a blank item onto the dataset after the set has
populated...
>maybe. (I'm pretty new myself) =)

I'm sure we could figure out a fix for what you need!

Try:
ddlShoots.Items.Insert(0,"")

That "should" put a 0 index item which "should" go at the top... but
who
>knows!



Jul 14 '06 #6

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

Similar topics

0
by: LV | last post by:
Hello, When I manually set a list view item to be a selected item, the SelectedIndexChanged event is not firing. Am I missing something here? using System; using System.Windows.Forms; ...
0
by: PeacError | last post by:
Using Microsoft Visual Studio .NET 2003, Visual C# .NET 1.1: I apologize if this question has been addressed elsewhere, but I could not find a reference to it in the search engine for this...
1
by: Edward | last post by:
I am having a terrible time getting anything useful out of a listbox on my web form. I am populating it with the results from Postcode lookup software, and it is showing the results fine. What...
0
by: Tand35006 | last post by:
Hi, I hope some one can help with this. I have a basic webform with 2 DropDownLists and a single DataGrid. What I am trying to do is populate the first DDList from a dataset on Form_Load. I then...
2
by: blue_nirvana | last post by:
I use a AddHandler statement in the load event of a form to assoicate a routine with a combobox. When I populate the form, I select the approiate value from the combobox by using...
1
by: kevin | last post by:
Hi, I'm working with VS 2005 and Framework 2.0 I have a datagrid with a link and the selectedindexchanged will not fire. The page posts back but does nothing. Protected Sub...
3
by: Alec MacLean | last post by:
Hi, I have a couple of win forms where I am editing values that are stored in a SQL database. I'm using the listbox control to hold the data object each form interacts with. Each object is...
2
by: jnoody | last post by:
The problem I am having is with the SelectedIndexChanged event not always firing or the SelectedIndex property not being correct when the event does fire. The code is below, but here are some...
3
by: martin1 | last post by:
Hi, All, I want user select first item (called All) in listbox, then all other items are selected by SetSelected method, but in loop (see code below) whenever going to SetSelected(), the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.