Thought: DataGrid isn’t a Control, it’s a Lifestyle

(This was inspired by a funny story left by Matt Hamilton)

"Where’s the Data Grid?"

When I talk to customers that are doing Windows Forms and evaluating WPF, this has to be the most common question. Their prayers will now be answered: a data grid will be included in the .NET 3.5 SP1.

Why did it take so long?

Personally, I’m glad the WPF team waited this long to ship a data grid. The Windows Forms team spent a lot of time building data grids, but they never did anything about making the rest of Windows Forms easier. Consequently, you could use the data grids, but heaven help he who wanted anything else.

The Data Grid Lifestyle

Over time we got used to it. No matter what kind of list you had, everything was a Data Grid. If our needs were really particular, we had plenty of third party data grids too. Spend any time in Windows Forms land and your brain will physically rewire itself to think in terms of data grids.

Take the Google reader UI, cleverly optimized for reading RSS feeds quickly. Who needs a Data Grid?

image

But an application designed with the same functionality in mind, RSS Bandit, when designed for a Windows Forms world can easily become, well, a Data Grid with Preview pane:

image

The Preview pane, funnily enough, is done with HTML, since Windows Forms made it so hard to do anything else but Data Grids (and not to knock RSS Bandit; it is still my favorite reader after Google Reader, and it’s still leaps and bounds ahead of the horrid Outlook 2007 feed reader).

Are Data Grids ever the best solution?

When you think about ways to visualize most data, there are actually few places where an inline editable data grid with paging and sorting and grouping really make sense. For almost every kind of data, there’s a better way to display it than a plain old grid. Data grids are the backup, solve-any-problem solution, but almost never the optimal solution. They are a great choice when you don’t really understand the application you are building or the data you are working with.

My hope is that .NET 3.5 SP1 will encourage line of business developers to try WPF, since there is a data grid, so that they can then discover the power of non-Data Grid UI’s and never actually use one :)

To paraphrase Chuck Jazdzewski: If you are using Data Grids in WPF, you are doing it wrong.

11 Responses to “Thought: DataGrid isn’t a Control, it’s a Lifestyle”

  1. “When you think about ways to visualize most data, there are actually few places where an inline editable data grid with paging and sorting and grouping really make sense.”

    That’s a very interesting position. What examples do you know of where a grid was used, where an alternative entry method was better? How do you deal with volume/analysis/enquiry business cases without a grid? With most enterprise applications I have been involved with, not having a grid, sorting and grouping made end users extremely irate.

    Do you find that different businesses and user types gravitate towards the use of grids or relate better to that information representation?

    – Dan =)

  2. Totally agree on this one - DataGrids are over used, and is seldom the best way to visualize data… But from time to time it is, and a missing grid huring WPF adoption.

    I must admit I’ve used the Silverlight DataGrid a couple of times (where it made sense…)

    Guess it’s like tables in HTML: Tables are for tabular data, not everything else..

  3. The main problem with grids, as I see it, is that they’re too *horizontal*.

    I’ve built plenty of apps with data grids (none of them editable), and they work ok for viewing data, but they’re hardly ideal.

    WPF’s ability to create list item templates means that you can have nicely laid out lists that don’t have to be the width of your desktop to see the data you need.

    Paul - have you played with .NET 3.5 SP1 yet? I haven’t, but I’ve seen reference to a “data repeater” control for WinForms. Could this be the control that gives us WPF-like templating for bound lists?

  4. […] DataGrid Isn’t a Control, It’s a Lifestyle (Paul Stovell) […]

  5. lol,

    “To paraphrase Chuck Jazdzewski: If you are using Data Grids in WPF, you are doing it wrong.”

    This is such a load of junk. Of course, if you are using a DataGrid in WPF, you are doing wrong. Why? Because there is no datagrid silly!

    To say that datagrids are a less optimal way to view data is simply ridiculous and is simply a cop out because WPF does not have one. The datagrid is a integral part of a developers toolset and when applied correctly adds tremendous value. Do you really think the Carousel adds value to a pure data entry app? Ha!

    Stop trying to flame the datagrid for WPF short comings. Yhe real problem is there is not one yet! Looks at Infragistics Data Grid. Not without its faults but overall an easy and effective tool to deal with.

    Give it a rest on the DataGrid guys. You are barking up the wrong grid..

  6. Never say never. On nearly all of my database-front end applications a DataGrid was the best way to present and edit the data. Plus nearly every user is comfortable in Excel so using a DataGrid reduces training.

  7. Like others, I can’t fully agree with the premise here. At first blush, you’ve given a nice example with Google Reader. However, look closer and the Google Reader *IS* a data grid. A fancy data grid, yes, but still a data grid. It’s a data grid with five columns: Starred, Source, Title, Date and what ever the chevron icon is supposed to represent (one would presume it’s the expanded/collapsed state, but it doesn’t change when you expand the entry). The inline preview is nicer than a separate preview pane, but that doesn’t really change the fact that what you have is a data grid.

    Are grids overused? Maybe. However, I’m willing to bet that even if you changed the cases where it made sense to use a better visualization, you’d only eliminate a fraction of the cases where a grid was used.

    What I will agree with, though, is that the WPF ListView + styling will easily account for many cases where developers are bemoaning the lack of a data grid today.

  8. Well, I cannot agree using data-grids indicate poor user-interface design! however, I’ve seen many cases in which UI designers (mostly developers) do not properly decide about that and simply represent all collections in lists/grids/…

    what I can say now is based on my own experience and a rule of thumb estimation, nearly 80% of rich application scenarios are begging for normal grids (both readonly and manipulation modes), and 50-60% of web scenarios go right with grid.

    also I’ve seen many users which do not notice when UI design is wrong by data-grid, and hence developers are probably on the safe side by employing some sort of grids anywhere they’ve not analysed all UI and accessibility requirements. so if you do agree, then this simply implies grids suit most cases!!!

  9. I have to say in many cases I agree with you, certainly when your displaying data to the user. However if you’re entering big quantities of data, or need to analyse it etc then a data grid is still very useful.

    Why do you think Excel is so popular? Granted not exactly the same concept but it is laying out data in a grid like format.

  10. Bit late to the party, but definitely agreed and guilty too.

    Another worthwhile comparison is WMP11 vs. iTunes. That table view in iTunes sucks because there’s no grouping and no clear and meaningful separation making it very monotonous when trying to browse through it.

    The data repeater control as part of the VB power pack helps out WinForms; unfortunate it isn’t a standard control.

    It’s just so much easier just dumping the DataGrid control on to the designer, hooking up data binding, and watching it magically come to life! No design, no thought, no creativity required :)

  11. All MS and Infragistic grids stinks in performance.

    WPF one will too..

    And btw, they always will.

    It is the most bloated piece of gridness ever.

Leave a Reply