DataList & dynamic columns

  • Thread starter Thread starter John Devlon
  • Start date Start date
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
 
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.
 
Back
Top