Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataGrid with totals
Message
From
04/03/2013 08:27:25
 
 
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Miscellaneous
Thread ID:
01567310
Message ID:
01567356
Views:
27
>>>>Hi,
>>>>
>>>>in XAML is there a way to add a row of totals to the bottom of a datagrid?
>>>>
>>>>For example I want something like this:
>>>>
>>>>
Invoice #   Invoice Amount
>>>>1234        100.00
>>>>1235        150.00
>>>>2           250.00
>>>>
>>>>where 2 is the count of invoices and 250.00 is the total of the Invoice Amount column.
>>>Is it feasible to add a total row to the data table?
>>
>>The problem I see with that is how to handle the sorting when a user re-orders the grid by clicking on the header.
>
>Hmm. Resizing and re-ordering of columns would work automatically. The difficulties would be in making sure the 'total's row was always the last regardless of sort order, not persisting it to the DB etc....

Yes, Viv
It's a kludge, but I've done it (blush)
I'm not familiar with the DataGrid, but the DataGridView has a property that prevents the user from change the sequence of the grid
Persisting to the DB should not be an issue if the datatable has been created only for display in the grid.
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform