formatting the data in a datagrid

R

Robert Batt

Hello,
I wish to format the data in one of the columns of a
datagrid so that it does not display more than 3 decimal
places. I have a datagrid call dgjobs and I have the
following code.

nb cm is a currency manager
Dim i As Integer


ts = New DataGridTableStyle(cm)

Me.dgjobs.TableStyles.Add(ts)

ts.GridColumnStyles(11).Width = 50
ts.GridColumnStyles(11).HeaderText = "B/C"
ts.GridColumnStyles(11).NullText = ""

How do I restrict the data in this column 11 to show only
3 decimal places

thanx in advance

Robert
 
N

Nicole Calinoiu

Robert,

Try using the Format property of the column style. e.g.:

ts.GridColumnStyles(11).Format = "F3"

HTH,
Nicole
 

Ask a Question

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.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top