DropDown List Question

DropDown List Question

am 25.01.2008 18:36:51 von marksommerville

I have an ASP DropDownList control with 40 ListItems. I want to limit
the display (after the user clicks the down-arrow) to show only 10
items and a scrollbar. Does anyone know how to do this?

Thanks,

Re: DropDown List Question

am 25.01.2008 18:42:24 von gnewsgroup

On Jan 25, 12:36 pm, marksommervi...@yahoo.com wrote:
> I have an ASP DropDownList control with 40 ListItems. I want to limit
> the display (after the user clicks the down-arrow) to show only 10
> items and a scrollbar. Does anyone know how to do this?
>
> Thanks,

A DropDownList does not have a scroll bar, maybe you are talking about
ListBox? And if that's the case, I guess you can rebind the ListBox
when some event happens.

Re: DropDown List Question

am 25.01.2008 18:46:57 von marksommerville

On Jan 25, 9:42 am, gnewsgroup wrote:
> On Jan 25, 12:36 pm, marksommervi...@yahoo.com wrote:
>
> > I have an ASP DropDownList control with 40 ListItems. I want to limit
> > the display (after the user clicks the down-arrow) to show only 10
> > items and a scrollbar. Does anyone know how to do this?
>
> > Thanks,
>
> A DropDownList does not have a scroll bar, maybe you are talking about
> ListBox? And if that's the case, I guess you can rebind the ListBox
> when some event happens.

Thanks for the reply but a dropdownlist always displays a scrollbar
after the user clicks the down-arrow to display the options and when
there are more items than it can display. I want to be able to control
the number of items displayed.

Thanks

Re: DropDown List Question

am 25.01.2008 19:02:00 von adwb

If you change the size attribute of an HTML but this is not
supported in ASP.NET DropDownList. If you just want another way to organize
those items you might be able to use this hack:
http://weblogs.asp.net/jeff/archive/2006/12/27/dropdownlist- with-optgroup.aspx

Have you considered using an ajax popup with a fixed size ListBox isntead of
a regular DropDownList?

"marksommerville@yahoo.com" wrote:

> On Jan 25, 9:42 am, gnewsgroup wrote:
> > On Jan 25, 12:36 pm, marksommervi...@yahoo.com wrote:
> >
> > > I have an ASP DropDownList control with 40 ListItems. I want to limit
> > > the display (after the user clicks the down-arrow) to show only 10
> > > items and a scrollbar. Does anyone know how to do this?
> >
> > > Thanks,
> >
> > A DropDownList does not have a scroll bar, maybe you are talking about
> > ListBox? And if that's the case, I guess you can rebind the ListBox
> > when some event happens.
>
> Thanks for the reply but a dropdownlist always displays a scrollbar
> after the user clicks the down-arrow to display the options and when
> there are more items than it can display. I want to be able to control
> the number of items displayed.
>
> Thanks
>

Re: DropDown List Question

am 25.01.2008 19:03:20 von gnewsgroup

On Jan 25, 12:46 pm, marksommervi...@yahoo.com wrote:
> On Jan 25, 9:42 am, gnewsgroup wrote:
>
> > On Jan 25, 12:36 pm, marksommervi...@yahoo.com wrote:
>
> > > I have an ASP DropDownList control with 40 ListItems. I want to limit
> > > the display (after the user clicks the down-arrow) to show only 10
> > > items and a scrollbar. Does anyone know how to do this?
>
> > > Thanks,
>
> > A DropDownList does not have a scroll bar, maybe you are talking about
> > ListBox? And if that's the case, I guess you can rebind the ListBox
> > when some event happens.
>
> Thanks for the reply but a dropdownlist always displays a scrollbar
> after the user clicks the down-arrow to display the options and when
> there are more items than it can display. I want to be able to control
> the number of items displayed.
>
> Thanks

I guess that's not the standard DropDownList of the .net framework.

Re: DropDown List Question

am 25.01.2008 19:58:23 von marksommerville

On Jan 25, 10:03 am, gnewsgroup wrote:
> On Jan 25, 12:46 pm, marksommervi...@yahoo.com wrote:
>
>
>
> > On Jan 25, 9:42 am, gnewsgroup wrote:
>
> > > On Jan 25, 12:36 pm, marksommervi...@yahoo.com wrote:
>
> > > > I have an ASP DropDownList control with 40 ListItems. I want to limit
> > > > the display (after the user clicks the down-arrow) to show only 10
> > > > items and a scrollbar. Does anyone know how to do this?
>
> > > > Thanks,
>
> > > A DropDownList does not have a scroll bar, maybe you are talking about
> > > ListBox? And if that's the case, I guess you can rebind the ListBox
> > > when some event happens.
>
> > Thanks for the reply but a dropdownlist always displays a scrollbar
> > after the user clicks the down-arrow to display the options and when
> > there are more items than it can display. I want to be able to control
> > the number of items displayed.
>
> > Thanks
>
> I guess that's not the standard DropDownList of the .net framework.

It is the standard control. Try creating a DDL with 90 items and see
what happens when you expand it.

Re: DropDown List Question

am 25.01.2008 20:00:31 von marksommerville

On Jan 25, 10:02 am, adwb wrote:
> If you change the size attribute of an HTML but this is not
> supported in ASP.NET DropDownList. If you just want another way to organize
> those items you might be able to use this hack:http://weblogs.asp.net/jeff/archive/2006/12/27/dropdown list-with-optg...
>
> Have you considered using an ajax popup with a fixed size ListBox isntead of
> a regular DropDownList?
>
Haven't tried the Ajax solution. It's not a big problem, just looks a
bit crap. I was just wondering if there was an easy solution. Thanks
anyways.

Re: DropDown List Question

am 25.01.2008 21:46:49 von Larry Bud

On Jan 25, 2:00=A0pm, marksommervi...@yahoo.com wrote:
> On Jan 25, 10:02 am, adwb wrote:> If you change th=
e size attribute of an HTML but this is not=

> > supported in ASP.NET DropDownList. If you just want another way to organ=
ize
> > those items you might be able to use this hack:http://weblogs.asp.net/je=
ff/archive/2006/12/27/dropdownlist-with-optg...
>
> > Have you considered using an ajax popup with a fixed size ListBox isntea=
d of
> > a regular DropDownList?
>
> Haven't tried the Ajax solution. =A0It's not a big problem, just looks a
> bit crap. I was just wondering if there was an easy solution. Thanks
> anyways.

I say let the browser handle it based on the window size. I think
it's a bigger hassel trying to scroll to the 11th item when 11 items
would fit perfectly fine on the screen.