0
votes

I am new to WPF. I know how to use the DataGridView control well in Windows Forms. But I see that the DataGrid is the alternative in WPF. I want a good example for adding and editing data in a DataGrid in WPF.

For example I have the following table in database:

Channel    Point    Value
_________________________
A          1        w
B          1        x
A          2        y
B          2        z

The above table has to be displayed in this format:

Point    A    B
_______________
1        w    x
2        y    z

The channels are not fixed, i.e, Channels C and D can also be present.

1
Always search before asking - Kamil Budziewski

1 Answers

0
votes

if you have created a database or a list, u can retrieve data and print on the datagrid..

database db = new database (); //database employees emp = new employees (); //list or table in db

var result1 = (from t in db.employees select t).ToList();

datagrid1.Itemssource=result1;

it prints the data on datagrid