Avatar of Dovberman
Dovberman
Flag for United States of America asked on

Need to add a vertical scroll bar to a datalist

Can this be done? I could not find a property to use.

A reference would be helpful.

Thanks,
ASP.NET.NET ProgrammingMicrosoft Development

Avatar of undefined
Last Comment
Dovberman

8/22/2022 - Mon
kmt333

You can through CSS
<asp:DataList ID="yourDataList" runat="server">
        <ItemTemplate>
        <div style="width:400px;height:500px; overflow:scroll;">
            // Your Content
        </div>
        </ItemTemplate>
</asp:DataList>

KMT
Jaime Olivares

you can do it indirectly. Put the datalist control inside a div tag with overflow capability. Something like:

<div style="overflow-x: hidden; overflow: scroll; width: 100%; height:500px">
Dovberman

ASKER
This places a scroll bar within each row and column.  I need a single scroll bar for the entire list similar to the listview.

Is this possible?

Thanks,
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
ASKER CERTIFIED SOLUTION
Jaime Olivares

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Dovberman

ASKER
Thanks,

I have a tutoring appointment at a local high school. I will try it this afternoon.

I found out that my first student was held back 2 grades after "experts" determined that she could not read. Within 15 minutes, I realized that she was highly intelligent but had vision issues.

The Lion's Club is now involved.
Dovberman

ASKER
Yes, Defining the datalist inside the css statement works.

<div style="overflow: scroll; width: 2in; height:500px">
        <asp:DataList ID="dlstEvalWatch" runat="server" DataKeyField="SymbolID"

Thanks,