Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Customizing a DataList

Status
Not open for further replies.

jerasi

Programmer
Jun 19, 2000
141
0
0
CA
Is it possible to display different fields in each item of a datalist?
For example the first item will display id, name, phone, is_person and the second item (it's not a person) will display comm_id, title, description, is_person.
My dataset contains all these fields. Depending on the "is_person" flag I want to display the different fields.
The reason I'm asking is that I still want to use the DataBind method, I would rather not create an HTML table for this and using a datagrid is not an option for me.
Thank you.

Let me put it this way:
While StressLevel Is High
Productivity -= 1
Marriage = Nothing
End While
 
The quick-and-dirty way to do this would be to create a panel for both views in the ItemTemplate (both of which are bound to fields in the DataSet), then hide/show them based on the is_person field.

Otherwise an alternate approach with dynamically loaded views presents state management issues which probably aren't worth the headache.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top