I have a WPF Datagrid, at initial stage i will assign 100 column header to Datagrid, but I am not able to horizontal scroll it to view all column headers.
DataGrid does not have any rows, ItemSource is null. How do I achieve horizontal scrolling when I have only column headers (no rows).
I binded ItemSource to a DataTable which has only column header and no rows.
How can I scroll in this scenario.
As ArsenMkrt said, it is not possible. But, I think you can add a row to your
DataTablebut after that, you can set its correspondingDatagridRow‘s Visibility to be Hidden.When your
DataTableis being populated with actual data, just clear DataTable.Rows.