views:

1277

answers:

2

Hello,

Does anyone how I can add a fixed last row / footer row to the WPF Toolkit DataGrid? I'd like to display a "summary" at the bottom of all Column Values.

Thank you.

Cheers

A: 

It's probably not the best way, but this is how I solved it:

   public class MyCollectionViewModel : ObservableCollection<SomeObject>
    {
        private readonly SomeObject _totalRow;

        public MyCollectionViewModel ()
        {
            _totalRow = new SomeObject() { IsTotalRow = true; };
            base.Add(_totalRow );
        }

        public new void Add(SomeObject item)
        {
            int i = base.Count -1;
            base.InsertItem(i, item);
        }
    }

Hope this might help anyone.

Cheers

Joseph Melettukunnel
+2  A: 

Another possibility would be to have a second DataGrid below your first grid, a summary DataGrid if you will.

You could perform data bindings to set the column sizings (if they are dynamic) and it would align nicely if placed in a grid layout in XAML.

Hope this gives you some ideas.

Alastair Pitts