Datagrids Suck!

I'm always telling everyone why I love Datagrids, but today let's air some "Datagrid dirty laundry".  Here are some reasons why Datagrids suck:

1) Dealing with ViewState and Datagrids is also a big hassle.  I mean, why is the ViewState for a page with a Datagrid so ridiculously large?  And if all the data's in there (ViewState), why can't we get it back out again after a postback?  And why does disabling the ViewState for a Datagrid make working with events such a pain?

2) If this thing (Datagrid) is generating HTML table tags, where are my TBODY, TH, THEAD, TFOOT elements??

3) Datagrid accessibility stinks, just try checking the HTML of a page with an ASP.NET Datagrid in your favorite accessibility validator.  See above.

4) Then there's that HeaderStyle-Wrap bug, definitely spent some time wrestling with that one.

5) Also in the semi-bug category, there's the whole "leaving secure connection" SSL thing.

Write me and tell me the things you hate about the Datagrid!
Datagrid Girl

Published Wednesday, April 30, 2003 7:53 AM by datagridgirl

Comments

# re: Datagrids Suck!

DataGrids do indeed suck, oh DataGrid girl, Mistress of Methods, High Priestess of Postbacks, Vixen of Viewstate.

I think the only thing that they're good for is the in-place editing of records. For everything else, I tend to use a repeater control so I can have _exact_ control over the html (I like valid markup... call me crazy).

Things like paging can be duplicated anyway. In fact, I think they should, because you wouldn't want to be pulling down all 5k records of data just to display 20, and as long as you're doing a custom stored proc to grab just 20, you might as well just write your own pager... they tend to lend themselves well to reuse anyway.

P.S. I liked your rant about VS.NET... you seem to have the ear of some M$FT folks... tell them to come out with a version that supports VALID HTML/XHTML. And while they're at it, how about a automatic formatting mode that _just_ does indenting, instead of destroying my markup, taking out my end slashes out of singleton elements (BR, IMG, etc.)?

Wednesday, April 30, 2003 9:46 AM by Matt

# re: Datagrids Suck!

Maybe you should come over to the side of XSLT generated tables using the Xml from the dataset!!! Its nice and sunny on this side.

Wednesday, April 30, 2003 9:56 AM by Jeff Julian

# Datagrid Girl

Datagrid Girl

Wednesday, April 30, 2003 10:53 AM by TrackBack

# Thumbs down from Datagrid Girl : Web Service Guy

Thumbs down from Datagrid Girl : Web Service Guy

Wednesday, April 30, 2003 10:53 AM by TrackBack

# re: Datagrids Suck!

I found your blog off of http://dotnetweblogs.com/ by the way...

I would have to admit, I really don't like the Datagrid control myself. First off while being a blessing the Javascript:doPostBack becomes a pain in the arse for some applications, it would be really handy if there was a property that would be <asp:datagrid DoPostBack="true"... /> to switch the postback option of a control on / off.

I also agree with Matt's comment about not handling the html / xhtml validation too well.

Mainly because of these issues I tend to use my own paging system and handle postback all on my own. Anyways I just wanted to say I really love ASP.NET, but dislike the majority of the controls with it (especially the Datagrid.)

Anyways just my 2 cents worth. I will say that I love the ability to bind data to the grid.

Justin (jwendl@hotmail.com)

Wednesday, April 30, 2003 2:09 PM by Justin Wendlandt

# re: Datagrids Suck!

My biggest bitch is that the templating only lets you do columns and does not allow for splitting table tags up - I like the repeater better because if i want to put a table tag in the header and the row tag in the item template and table close in the footer, it lets me :)

Wednesday, April 30, 2003 4:00 PM by Dana Coffey

# re: Datagrids Suck!

You should take a look at this

http://www.angrycoder.com/blog/entries/20030430.html

Wednesday, April 30, 2003 11:45 PM by Samer Ibrahim

# re: Did you want to google tell everybody "Datagrids Suck!" ?

Hello here,

just to say that is mostly why I prefer Repeater control or my own derived from BaseDataList (because I don't like the <%#DataBinder....()%> that is huge when I work with custom entities).

I think the viewstate issue is only due to the proliferation of the public properties of each control instanciated within the DataGrid as well of DataBoundLiteralControls that are instanciated much times. Remember that Viewstate is used to remember every public properties of the control tree (talking about the controls in System.Web.UI namespace)

PS: I suppose that now if we type "datagrids suck!" in google, this post is ranked #1 ;)

PPS: there is an option in vs.net to allow the html editor to not destroy your markup every time you switch in design mode, there is even an option 'Lower case' for attribute and element names, I can tell it REALLY worth the setting!

Sunday, June 29, 2003 2:47 PM by Gauthier

# re: Datagrids Suck!

I want inplace editing of HTML documents stored in my database in memo fields.

Why doesn't datagrid have inplace editig of HTML documents?

Just a matter of time before a 3rd party vendor comes up with one.

Wednesday, December 17, 2003 9:52 PM by philip stilianos

# re: Datagrids Suck!

I use the repeater like most. I found that the styles to dont work for the datagrid regardless of what tags you use.

Wednesday, January 07, 2004 3:28 PM by Matt Sword

Leave a Comment

(required) 
(required) 
(optional)
(required)