Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is DataGrid a necessity in WPF?

Tags:

I have seen a lot of discussions going on and people asking about DataGrid for WPF and complaining about Microsoft for not having one with their WPF framework till date. We know that WPF is a great UI technology and have the Concept of ItemsControl,DataTemplate, etc,etc to make great UX. Even WPF has got a more closely matching control- ListView, which can be easily templated to give better UX than a traditional Datagrid like display. And I would say a readymade DataGrid control will kill or hide a lot of creativity and it surely will decrease the innovations in User Experience field.

So what is your opinion about the need of DataGrid in WPF as a Framework component? If you feel it is necessary then is it just because the world is so used to the DatGrid way of data display for many years?

Some other threads having the discussion about DatGrid are here and here

Link to WPF ToolKit - Latest WPF DatGrid

like image 242
Jobi Joy Avatar asked Sep 24 '08 17:09

Jobi Joy


People also ask

What is the difference between grid and DataGrid in WPF?

A Grid is a control for laying out other controls on the form (or page). A DataGrid is a control for displaying tabular data as read from a database for example.

What is the purpose of using DataGrid control?

A common use of the DataGrid control is to display a single table of data from a dataset. However, the control can also be used to display multiple tables, including related tables. The display of the grid is adjusted automatically according to the data source.

What is the difference between DataGrid and DataGridView?

The DataGrid control is limited to displaying data from an external data source. The DataGridView control, however, can display unbound data stored in the control, data from a bound data source, or bound and unbound data together.

What is WPF DataGrid?

A DataGrid is a control that displays data in a customizable grid. It provides a flexible way to display a collection of data in rows and columns.


2 Answers

DataGrids are excellent for displaying large amounts of tabular data bound to a backing store.

But what happened in the WinForms world was that people often used them for everything that required a multi-element scrolling list. Souped-up third-party DataGrids soon became available that allowed columns and fields to contain buttons and ComboBoxes and icons, etc.

The DataGrid became a workhorse because there was a need for something it could be coaxed into behaving like. Similar happened to DataTables before generic collections came along--and when you're using lots of DataTables, presenting it in the UI with a DataGrid is the path of least resistance.

I think that when WPF came out, a lot of programmers like me were still thinking in this fashion, and sought out WPF ports of the DataGrid concept.

like image 184
Chris Wenham Avatar answered Sep 18 '22 17:09

Chris Wenham


Can't think of a better control to display tabular data, especially in business apps where you don't want to reinvent the wheel by templating/developing a (Headered)ItemsControl to make it behave like the good old DGV. I'm sure you saw this.

like image 21
radu_c Avatar answered Sep 17 '22 17:09

radu_c