views:

866

answers:

5

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.

+3  A: 

I always use repeater control instead of others. Because i feel free with it. I build up the html by myself and can do a lot of thing like paging sorting. But of course you need more effort for the repeater for these kind of functionality.

For CRUD operations, i use jQuery thickbox (modal pop up and iframe).

My choice is Repeater

Barbaros Alp
I mostly build apps where the userbase is in their 40's. Using jquery really confuses them and at times they feel its not required to get so much responsiveness.
Perpetualcoder
+1 for repeater. You have complete control over the html. And it's not hard to hook up events to the controls that you place inside it.
darasd
+1  A: 

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.

achinda99
+1  A: 

I despise it, every time I've used it or seen another developer use it, they almost always end up going with something else. I've never once heard any developer I've worked with say "I love GridView".

Allen
Three or four years ago, there wasn't much of an alternative unless you wanted to hand code something similar to it. Third party controls were weak. I hate it with a vengeance now, but you needed it back then.
achinda99
Oh yeah def, back in the dark ages :)
Allen
A: 

Hi Perpetualcoder,

Here's an article worth reading. Try this

It may come handy

naveen
This is what I dont want to do
Perpetualcoder
A: 

You can hook up the GridView and DetailsView and use basic SQL scripting or complex business objects along with DetailsView.

I have found DetailsView to be very useful.

Abhishek