|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ddl selectedindexchanged not firing on first item - I'm using a dataset to populate the ddlHi
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
Show quote
Hide quote
"Cindy H" <nonn***@nowhere.com> wrote in What is it you are attempting to do? I guess I'm kind of confused because news:#NUAh82pGHA.4116@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 > > 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! 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 Show quoteHide quote "Zamael" <nore***@gmail.com> wrote in message news:Xns9800927104603noreplygmailcom@63.218.45.254... > "Cindy H" <nonn***@nowhere.com> wrote in > news:#NUAh82pGHA.4116@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!
Show quote
Hide quote
"Cindy H" <nonn***@nowhere.com> wrote in Try:news:ey4#TR3pGHA.4196@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" <nore***@gmail.com> wrote in message > news:Xns9800927104603noreplygmailcom@63.218.45.254... >> "Cindy H" <nonn***@nowhere.com> wrote in >> news:#NUAh82pGHA.4116@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! > > > ddlShoots.Items.Insert(0,"") That "should" put a 0 index item which "should" go at the top... but who knows! hey - thank you - that's what I was looking for!
Show quoteHide quote "Zamael" <nore***@gmail.com> wrote in message news:Xns980095EC8E398noreplygmailcom@63.218.45.254... > "Cindy H" <nonn***@nowhere.com> wrote in > news:ey4#TR3pGHA.4196@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" <nore***@gmail.com> wrote in message > > news:Xns9800927104603noreplygmailcom@63.218.45.254... > >> "Cindy H" <nonn***@nowhere.com> wrote in > >> news:#NUAh82pGHA.4116@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! You're very welcome :)
"Cindy H" <nonn***@nowhere.com> wrote in news:#MXmVZ3pGHA.1548 @TK2MSFTNGP04.phx.gbl:Show quoteHide quote > hey - thank you - that's what I was looking for! > > > > "Zamael" <nore***@gmail.com> wrote in message > news:Xns980095EC8E398noreplygmailcom@63.218.45.254... >> "Cindy H" <nonn***@nowhere.com> wrote in >> news:ey4#TR3pGHA.4196@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" <nore***@gmail.com> wrote in message >> > news:Xns9800927104603noreplygmailcom@63.218.45.254... >> >> "Cindy H" <nonn***@nowhere.com> wrote in >> >> news:#NUAh82pGHA.4116@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! > > >
C.NET VS VB6
Using A Bound Dataset to insert new Seeking Design Advice What's wrong with the combobox in grid programatically created checkboxes within panels again.... Dataset to excel DirectCast of object to interface doesn't work Dataset to excel Why won't DateTimePicker work? Copyrighting a program |
|||||||||||||||||||||||