3

I got a dataset which contains news items. Each news items contains elements like: id, title, briefDesc, fullDesc, imgUrl, dateCreated, etc. I want to show them in a list using a ListView and DataPager, but don't know how to created the ListView and datapager dynamically from code behind!

My platform is ASP.NET 4.5 (C#)

Any suggestion or practical sample would be highly appreciated.

Kardo
  • 1,658
  • 4
  • 32
  • 52
  • If you want to use a repeater with a datapager I believe you will have to start by extending the control e.g. http://www.codeproject.com/Articles/45163/Extend-Repeater-to-support-DataPager I don't know the details of your project but if you definitely want to use a datapager you might want to look into the ListView control instead of the repeater control – chris_dotnet Jun 11 '13 at 17:11
  • @chris_dotnet, I changed my question. In fact I just want to show some rows of data, with pagination. The resources I found in net are static, not database (dataset or datatable) base. – Kardo Jun 15 '13 at 15:17

1 Answers1

0

I'm not clear on why you want to create the controls dynamically. It sounds like you would be better off simply using a GridView

m0r6aN
  • 850
  • 1
  • 11
  • 19