In cs file
DataTable employeeData = CreateDataTable();
gridEmployees.DataContext = employeeData.DefaultView;
In xaml file
<DataGrid Name="gridEmployees" ItemsSource="{Binding}">
More Related Contents:
- Data is visible in DataSet visualizer but does not show in a DataGrid
- How to get ToolTip from WPF Data Grid Column Header (DataGridTemplateColumn) in code?
- Change DataGrid cell colour based on values
- Accessing UI (Main) Thread safely in WPF
- programmatically add column & rows to WPF Datagrid
- Select multiple items from a DataGrid in an MVVM WPF project
- Datagrid binding in WPF
- DataGrid get selected rows’ column values
- WPF iterate through datagrid
- DataGrid shows path of image instead of image itself
- How can I set the color of a selected row in DataGrid
- Improve WPF DataGrid performance
- How to hide wpf datagrid columns depending on a property
- DataGrid column width doesn’t auto-update
- WPF Datagrid Get Selected Cell Value
- How to loop over the rows of a WPF toolkit Datagrid
- Button in a column, getting the row from which it came on the Click event handler
- Merge Cells in WPF DataGrid
- DataGrid row content vertical alignment
- WPF DataGrid: DataGridComboxBox ItemsSource Binding to a Collection of Collections
- FindVisualChild reference issue
- OpenClipboard failed when copy pasting data from WPF DataGrid
- How do I bind a List to a WPF DataGrid?
- ScrollIntoView for WPF DataGrid (MVVM)
- Binding datagrid column width
- WPF DataGrid – Event for New Rows?
- How to bind column header to property in ViewModel? (WPF MVVM)
- Add context menu in datagrid, how to get the select Item value
- Sort a wpf datagrid programmatically
- WPF DataGrid CustomSort for each Column