How to strip Gotten data from Datatable and bind some of it to Headertemplate from Datalist

Maybe the topic is complex, so I'll try to explain:

I am getting some data from the database, some of which have TypeId = 1 and some have TypeId = 2. I want to take data that has TypeId = 1 in the header template and TypeId = 2 in the itemtemplate in the Datalist control.

How can i do this?

0


source to share


1 answer


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



0


source







All Articles