Click to See Complete Forum and Search --> : Change layout of rows in DataList in accordance with data


cyberpilgrim
05-28-2004, 04:00 AM
Folks,

I have following situation:
I want to make table, rows of which would contain different appearence in accordance with data they were fed. For instance, when I have plain data there should be 1 textbox and when I have href then there should be 2 textboxes (for URL and COver respectively).
Currently I try to do it using DataList. But it goes not so good. And from this point of view I do not see any difference between DataList, DataGrid and Repeater. The only way to solve it I see by now is to manage property visible of some elements.
But I'm curious if there are any better solutions.

Thank you in advice.

PeOfEo
05-31-2004, 03:11 PM
repeater would give you the most control. You can have raw html inside of the temp and then put in the data for the css attributes and style it. You could also, if you wanted 100% control of everything, us a <% loop here %> loop within the code and have it loop through the data set printing the records with data and style it as you go that way, but this is kind of a pain in the butt, it is how data bound stuff was done with asp classic.