There is a DataGrid with a known unknown number of columns and rows.
When the application is started, a config file is read and a collection of columns is generated on its basis:
<DataGrid Name="lstInfo" Margin="5" AutoGenerateColumns="False"/> lstInfo.Columns.Add((DataGridColumn)Resources["colDistrict"]); for (int i = 0; i < Queries.Count; ++i) lstInfo.Columns.Add(new DataGridTextColumn { Header = Queries[i].Name, Binding = new Binding($"Values[{i}]") { Mode = BindingMode.OneWay } }); lstInfo.Columns.Add((DataGridColumn)Resources["colProgressBar"]); Now there is a task to display the last line of the grid (or, most likely, just under the grid, it doesn’t matter how it goes) the line "TOTAL".
How to do it?
So far, as a temporary solution - I added another DataGrid without headers from below, this solution suits in principle, but now we need to bind the width of the columns to the width of the columns of the upper DataGrid 