Hi,
Where you add a tablestyle to your grid try something like this.
Dim cm As CurrencyManager = CType(Me.BindingContext(datagrid1.datasource),
CurrencyManager)
Dim pd As System.ComponentModel.PropertyDescriptor =
cm.GetItemProperties()("Qty")
Dim colQty As New DataGridTextBoxColumn(pd, "G")
With colQty
..MappingName = "Quantity"
..HeaderText = "Qty"
..Width = 50
End With
http://msdn.microsoft.com/library/de...stdatagrid.asp http://msdn.microsoft.com/library/de...asicprimer.asp
Ken
----------------------------
"KevinW" <be****@msn.com> wrote in message
news:ff**************************@posting.google.c om...
I need to format a currency column in a datagrid. The line I have
tried is:
Me.DataGrid1.TableStyles(0).GridColumnStyles(3).To String.Format("#,##0.00")
It does not work. I can format the currency in the editor, but I need
to be able to do it in code. The column in question is a decimal in
the dataset.
I am sure there is an easy way to do this but I just can't figure it
out. All the other GridColumnStyle changes to this Datagrid work
fine. I am just having problems doing a format.
Kevin