Jaco Posted July 10, 2006 Posted July 10, 2006 I'm trying to set up a currency value column in a DataGridView (2005) and I'm following examples from Microsoft on how to do this, but the currency formatting is being ignored. Here's how the samples (from Microsoft) indicate how it's done: Dim col As New DataGridViewTextBoxColumn() col.DefaultCellStyle.Format = "C" 'also tried lower case "c", but no luck ... <other properties such as header text etc.> ... MyGrid.Columns.Add(col) But when values are set on that column, they appear as plain numbers, not currency (i.e., no '$', no comma, etc.). Quote
mjb3030 Posted July 25, 2006 Posted July 25, 2006 Try this: Dim col As New DataGridViewTextBoxColumn() col.DefaultCellStyle.Format = "C" col.ValueType = GetType(Double) MyGrid.Columns.Add(col) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.