D
deko
I have a DataTable that is bound to a DataGrid that displays a number of
selections from a product menu:
Item1 quantity price totalAmount
Item2 quantity price totalAmount
TAX - - - - - - - - - - totalAmount
TOTAL - - - - - - - - totalAmount
Each time the user makes a selection, the DataTable is updated and re-bound
to the DataGrid.
The problem is I need to keep the TAX and TOTAL rows as the last rows in the
DataTable so they appear at the bottom of the DataGrid. But the only way I
know how to do this is to delete the rows every time the user makes a
selection from the product menu, then recalculate the order, and lastly
reinsert the rows in the DataTable (otherwise the user's most recently
selected product is the last row in the DataTable and appears at the bottom
of the DataGrid).
Is there a way to re-order the rows rather than deleting and re-inserting
every time? Is there some way to tell the data table that the Total row
should be the last row in the table, and the Tax row second-to-last? That
way I could just overwrite the value in those rows rather than deleting and
re-inserting after each time the users selects another item.
Thanks in advance.
selections from a product menu:
Item1 quantity price totalAmount
Item2 quantity price totalAmount
TAX - - - - - - - - - - totalAmount
TOTAL - - - - - - - - totalAmount
Each time the user makes a selection, the DataTable is updated and re-bound
to the DataGrid.
The problem is I need to keep the TAX and TOTAL rows as the last rows in the
DataTable so they appear at the bottom of the DataGrid. But the only way I
know how to do this is to delete the rows every time the user makes a
selection from the product menu, then recalculate the order, and lastly
reinsert the rows in the DataTable (otherwise the user's most recently
selected product is the last row in the DataTable and appears at the bottom
of the DataGrid).
Is there a way to re-order the rows rather than deleting and re-inserting
every time? Is there some way to tell the data table that the Total row
should be the last row in the table, and the Tax row second-to-last? That
way I could just overwrite the value in those rows rather than deleting and
re-inserting after each time the users selects another item.
Thanks in advance.