views:

202

answers:

2

hello,

Can anyone tell me the difference between DataGrid(not GridView) and Grid controls in wpf?

Thanks

+3  A: 

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.

ChrisF
I'm not asking about GridView but DataGrid control.
Archie
@Archana - sorry, I got confused there. However, the distinction is still valid. Correct link now added.
ChrisF
A: 

You can think of the Grid as a combination of the Windows Forms background layout and a spreadsheet (in that you can have rows and columns) into which you can add controls and position them.

The Grid view is a View element that can be used in a ListView control to display data from database, XML or even CLR objects, in columns and rows with column headers and row indicators, similar to (but not exactly like) the DataGrid control in Windows Forms. GridView is only really usable as part of a ListView AFAIK.

So something like this:

<ListView>
    <ListView.View>
        <GridView/>
    </ListView.View>
</ListView>

Cory

OffApps Cory