R – Is the ASP.net GridView control a clever design

asp.netcrudgridview

I have been using gridview since a long time. I have a "cant live with you and cant live without you" relationship with it.

The idea of Edits, inserts and deletes from within the grid is great but having to do something like

var sometext = ((TextBox)editRow.FindControl("tbSomeText")).Text;

just seems very un-clever to me. Has anyone comeup with a solution or knows (resource) where you perform CRUD operations + paging and sorting from within the grid and dont have to write ugly code (like above). I am not looking for solutions using DataSource objects since I am not its biggest fan. I will be happy if someone can tell me how to live without GridView in asp.net.

I understand there are AJAX implementations but I am looking for something completely serverside.

Best Answer

If you are trying to make a basic CRUD website, have a look at ASP.NET 3.5 Dynamic Data which is a great website to add as a pure data access website with CRUD ability. However, its extremely customizable.

Gridview has its advantages and I used to love it in the .Net 2.0 times about two/three years ago. However, since then there are much better .Net 3.5 controls (like ListView) that give you a better ability to customize content. I'd also have a look at many third party grid tools from (Telerik, Infragistics, ComponentArt, ComponentOne, DevExpress) that have a lot more capability than the inbuilt gridview control.