In my solution, I have included a helper class to encapsulate some of these
standard settings. In that class, I have a function which gets a standardized
(for my application) currency formatter as follows:
Public Function DGCurrencyStyle() As DataGridViewCellStyle
Dim Style As New DataGridViewCellStyle
Style.Alignment = DataGridViewContentAlignment.MiddleRight
Style.Format = "c2"
Return Style
End Function
To use it, I modify the .Designer file and set the DataGridViewTextBoxColumn1.DefaultCellStyle=MyHelper.DGCurrencyStyle.
This way, if I want to change the style throughout my system, I just change
it in the helper and the change is reflected throughout the system.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.