Saturday, 15 May 2010

wpf - Translating numeric value in DataTable for editing without marking as Modified -


I have a SQL table that I have read in a DataTable one of the columns I Ratio, but I'd like the value displayed as a percentage of user editing ( ie. multiplied by 100). Is there an easy way to do this translation in DataGrid (or elsewhere?) So that I do not have to repeat every record to multiply by 100, then display it, then all to 100 Split over at all?

Not sure what this will do for you, but you string format - In this way a ...

  & lt; Text box text = "{binding path = percentage, string format = {} {0: P2}}" />   


Note: it really works :) - and e.g. It translates 85.55% to 0.8555 (increase the percentage on wish)

Edit:
Two Actually editing for the keys - you will need a converter

You can use it here

No comments:

Post a Comment