I am trying to make an invoice program, and i am trying to show the objects in a dynamic way inside a DataGrid
. There would be only one column that the object has "Name", and extra columns like tax%, discount % and amount.(As an IntegerUpDown
from xceed Toolkit).
Now what i need is another column that will show the total price by taking the price per product(part of the original object), multiplying it by the amount, adding tax and removing discount%.
I have seen many implementations, but i cant understand the logic behind it. I will create an object (Item) with the attributes that i need (name, price) and some functions like "total_Price" and event PropertyChangedEventHandler? But how i will be able to connect the "tax" , "discount" that are at the same row? If i add them into the object Item and hence to be able to refer to them, how i will be able to manipulate them through the DataGrid
. If i change them there (at the DataGrid
through the IntegerUpDown
button), will they change in the actual object?
I am really new with wpf and especially with data-templates and stuff so i cant really get my head around the logic of it! A hint would be good at least on how i could start!