DataList & dynamic columns

J

John Devlon

Hi,

Can anyone please help me?

I've used a DataList, using 3 fixed columns, to display some information.

How can I adjust the datalist controle to use less or more columns if the
window is resized. You see this functionality on many sites but I can't
figure out how its been done. Does anyone know how?

Thanx

john
 
G

Guest

Hi,

Can anyone please help me?

I've used a DataList, using 3 fixed columns, to display some information.

How can I adjust the datalist controle to use less or more columns if the
window is resized. You see this functionality on many sites but I can't
figure out how its been done. Does anyone know how?

Thanx

john

I think that changing number of columns in the standard asp server
control is not possible without a postback or refresh the browser. It
means, if you implement such behaviour, the page would postback to the
server each time you resize the window, which is an absurd. What you
can do is, try to add a parent div container with overflow:hidden and
put your datalist into it. I think this could help dynamically "clip"
the region which is out of space on the current layout.

http://www.w3.org/TR/CSS2/visufx.html

DataList control renders its grid of data into an HTML <table>. So,
another way could be a javascript which could enumerate all rows in
that table, find third column in each row and set its style to
visibility:hidden when necessary.
 

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

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,142
Latest member
DewittMill
Top