Here we all know the WPF Datagrid always comes with the extra column at the end, so multiple people are asking why the extra column is showing in the Datagrid, example: where the DB (Database) table or Model class contains 5 columns but after the source added the columns showing 6, without header.

Here, Datagrid is an XAML control in the WPF framework, where DataGrid cannot show the columns count on its own, so every time after passing the itemsource value it is showing by default columns with value. This extra column depends on the header it is mentioning and the width of the columns, which is nothing but the width distribution of DataGrid.

Below I will show you how to resolve this issue.

In Xaml code of the DataGridWindow.xaml, needs to add one small attribute which is "ColumnWidth="*" into DataGrid control.

Columnwith

Now Rebuild the code and execute. The below window will show that the extra column has already been removed from DataGrid control and Data is fitted to the complete DataGrid.

Complete data grid

Thank you