Using a DataSet with a DataGrid

I have a DataSet that I create at runtime. I would like to display this information in a datagrid using wpf and display some columns selected at runtime.

I can display the data using:

datagrid.ItemsSource = dataset.Tables[0].DefaultView;
datagrid.DataContext = dataset.Tables[0];

How to use a DataGridTemplateColumn to add columns to a data grid and display information about a data set or other arbitrary data in them (numbering, etc.)?

Thank.

+3
source share
1 answer

Check if these previous StackOverflow questions answer:

(Here is the search I used).

datagrid ( Binding). , DataGridBoundColumn, DataGridTextColumn.

+2

Source: https://habr.com/ru/post/1784034/


All Articles