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

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

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
"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

P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.