ASP.NET GridView examples – Using code-behind – no wizards – no drag/drop

asp.netgridview

I am looking to implement and learn more about the ASP.NET GridView control. However, all the examples I have found seem to focus on setting up a SQL Datasource within the ASPX page. I prefer to keep markup as seperate as possible from code and therefore all datasource binding I like to do in the code-behind. So it would be great to see an example that setup the GridView in that manner.

Also, most of the examples, I have seen, step through using the Visual Studio IDE and wizards to implement the GridView. I would like to see how it is done from a pure code point of view.

Does anyone have any examples or perhaps know of some resources that describes usage of the GridView control in the manner in which I described?

It would be great to see an example(s) that cover sorting, paging, and CRUD operations. Thanks for your time.

Best Answer

A simple example that includes sorting and paging. Gridview Example. Obviously you just need to plug in your call to your DAL and put the data in a DataTable. Though the example is simplistic, I think it conveys what is needed to get rolling.

Related Topic