How to change DataList height

A

Angel

How can I change the number of items that are seen without scrolling in
DataList.
I tried with changing DataList.Height but it does not seems to work.

Thanks
Angel
 
R

Robert Koritnik

Using Javascript on the client side like:
document.getElementById('listboxid').size = N;

Using codebehind on server side like:
listboxid.Rows = N;

In both examples N denotes a positive integer. On the serverside Rows
defaults to 4, but you can change it.

On the serverside Height property denotes a height in any acceptable unit
(normally in pixels) that is set on the client side as CSS style.
 
A

Angel

I am talking about
System.Web.UI.WebControls.DataList

DataList does not have Rows property
 
R

Robert Koritnik

Sorry. Silly me. By some higher power I was thinking about ListBox
control...

Ok. So We have a DataList. k. A DataList control renders as a <TABLE>
element on the client side. Ok thinking about a DataList I don't exactly get
what you want to acomplish. If I understand the problem you would like to
make shure that a certain ammount of items are displayed in the client
window. The number of items on the page depends on:
- the font size you use
- line hight set by CSS
- window size
- direction of your datalist item display

Could you please explain a little bit more what do you need to do? I still
don't think that I really get what you want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top