views:

171

answers:

2

May be the subject is complicated, so I'll try to explain:

I get some data from database which some of them has TypeId=1 and some has TypeId=2. I want to take data which TypeId=1 to header template and TypeId=2 to itemtemplate in the Datalist control.

How can I do it?

A: 

You can use a DataView to get a subset of the data in a DataTable and then bind that to the DataList for the item content, but you'll have to manually insert the data into the heading by attaching to the ItemDataBound event and looking for the ListItemType of Header.

Kevin Gorski
A: 

Can you show a simple code about inserting data into headertemplate in the itemdatabound event?

mavera