Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - drop down list problems

 
Thread Tools Search this Thread
Old 12-19-2006, 06:23 PM   #1
Default drop down list problems


Hello,
is there a way to get this webcontrol to behave more like its winform
cousin?
In a winform dropdown, you can set the SelectedIndex to -1 and no items will
be showing in the drop list. This doesn't seem to work with the web control.
This bring up the issue of the first item in the list being displayed after
adding items to the drop down. However, you cause the SelectedIndexChanged
event you'd have to select a different item and then come back to the first
item to get the selectedindexchanged to fire for the first item in the list.
Is there a way around these couple of issues? I'm very new to ASP.NET stuff.

Thanks
S




SAL
  Reply With Quote
Old 12-19-2006, 06:26 PM   #2
Karl Seguin
 
Posts: n/a
Default Re: drop down list problems
Would adding a blank item at the top solve your problem?

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/


"SAL" <SAL_@NoNo.com> wrote in message
news:%...
> Hello,
> is there a way to get this webcontrol to behave more like its winform
> cousin?
> In a winform dropdown, you can set the SelectedIndex to -1 and no items
> will be showing in the drop list. This doesn't seem to work with the web
> control. This bring up the issue of the first item in the list being
> displayed after adding items to the drop down. However, you cause the
> SelectedIndexChanged event you'd have to select a different item and then
> come back to the first item to get the selectedindexchanged to fire for
> the first item in the list. Is there a way around these couple of issues?
> I'm very new to ASP.NET stuff.
>
> Thanks
> S
>




Karl Seguin
  Reply With Quote
Old 12-19-2006, 06:34 PM   #3
SAL
 
Posts: n/a
Default Re: drop down list problems
Hmmm, that's awfully simple Karl. Let me see....

S

"Karl Seguin" < > wrote in
message news:%...
> Would adding a blank item at the top solve your problem?
>
> Karl
>
> --
> http://www.openmymind.net/
> http://www.fuelindustries.com/
>
>
> "SAL" <SAL_@NoNo.com> wrote in message
> news:%...
>> Hello,
>> is there a way to get this webcontrol to behave more like its winform
>> cousin?
>> In a winform dropdown, you can set the SelectedIndex to -1 and no items
>> will be showing in the drop list. This doesn't seem to work with the web
>> control. This bring up the issue of the first item in the list being
>> displayed after adding items to the drop down. However, you cause the
>> SelectedIndexChanged event you'd have to select a different item and then
>> come back to the first item to get the selectedindexchanged to fire for
>> the first item in the list. Is there a way around these couple of issues?
>> I'm very new to ASP.NET stuff.
>>
>> Thanks
>> S
>>

>





SAL
  Reply With Quote
Old 12-19-2006, 07:00 PM   #4
David Wier
 
Posts: n/a
Default Re: drop down list problems
I'd suggest to also set your 'value' to -1, especially if queries using the
items are based on a numeric value

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com


"SAL" <SAL_@NoNo.com> wrote in message
news:...
> Hmmm, that's awfully simple Karl. Let me see....
>
> S
>
> "Karl Seguin" < > wrote in
> message news:%...
> > Would adding a blank item at the top solve your problem?
> >
> > Karl
> >
> > --
> > http://www.openmymind.net/
> > http://www.fuelindustries.com/
> >
> >
> > "SAL" <SAL_@NoNo.com> wrote in message
> > news:%...
> >> Hello,
> >> is there a way to get this webcontrol to behave more like its winform
> >> cousin?
> >> In a winform dropdown, you can set the SelectedIndex to -1 and no items
> >> will be showing in the drop list. This doesn't seem to work with the

web
> >> control. This bring up the issue of the first item in the list being
> >> displayed after adding items to the drop down. However, you cause the
> >> SelectedIndexChanged event you'd have to select a different item and

then
> >> come back to the first item to get the selectedindexchanged to fire for
> >> the first item in the list. Is there a way around these couple of

issues?
> >> I'm very new to ASP.NET stuff.
> >>
> >> Thanks
> >> S
> >>

> >

>
>





David Wier
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting the default value as"3years" in the drop down list bhaskarjava Software 0 09-22-2009 10:21 AM
Drop Down list Problem bazooka Software 1 08-18-2009 08:35 AM
databound Drop Down List not changing on new selection KROSS General Help Related Topics 0 01-21-2008 04:48 PM
Re: Doug's DVD List Doug MacLean DVD Video 13 05-29-2007 05:49 AM
New Releases: Schindler's List, The Front, 10 Commandments: Updated complete downloadable R1 DVD DB & info lists Doug MacLean DVD Video 2 12-13-2003 03:17 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46