Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1170
XamDataGrid Bind to SummaryResults
posted

I'd like to display the sums of several fields in some Label UIElements, separate from the grid. I discovered that I can programmatically enable the sum calculation for the fields I need and bind my Label's Content to the SummaryResults, like so:

<Label Grid.Row="0" Grid.Column="1" Foreground="Blue" FontSize="9" Content="{Binding ElementName=DataGrid, Path=Records.SummaryResults[5].Value, Mode=OneWay}"/>

However there are a couple of issues. Ideally I would not show the summary row at all since it's a redundant display, but setting SummaryDisplayArea="None" results in the summary values never getting calculated - my Labels just remain blank. To compromise I thought I'd try "Bottom" so it would be less obtrusive, but then I realized that when the grid starts filling in and the summary row gets pushed below the visible vertical area my labels stop updating.

Is there a way to get either my ideal setup of a hidden summary row, or at least one that's not pinned to the top of the grid, but still pull from the SummaryResults collection for my bindings? Thanks.