By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,699 Members | 1,372 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,699 IT Pros & Developers. It's quick & easy.

How to format text in Datagrid.

P: n/a

How do I format text in datagrid column? I have a column of currency
values and I want them all to display with 2 decimal points (XXX.XX).

I figured out how to set the width and alignment as follows:

DataGrid1.TableStyles(0).GridColumnStyles(0).Width = 140
DataGrid1.TableStyles(0).GridColumnStyles(1).Width = 125
DataGrid1.TableStyles(0).GridColumnStyles(0).Align ment = 0
DataGrid1.TableStyles(0).GridColumnStyles(1).Align ment = 1
P.S. Am I the only one who finds the Datagrid to be incredibly
complicated?

Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

Add a tablestyle to your datagrid

http://msdn.microsoft.com/library/de...stdatagrid.asp

http://msdn.microsoft.com/library/de...asicprimer.asp

Ken
---------------------
<cr***@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...

How do I format text in datagrid column? I have a column of currency
values and I want them all to display with 2 decimal points (XXX.XX).

I figured out how to set the width and alignment as follows:

DataGrid1.TableStyles(0).GridColumnStyles(0).Width = 140
DataGrid1.TableStyles(0).GridColumnStyles(1).Width = 125
DataGrid1.TableStyles(0).GridColumnStyles(0).Align ment = 0
DataGrid1.TableStyles(0).GridColumnStyles(1).Align ment = 1
P.S. Am I the only one who finds the Datagrid to be incredibly
complicated?
Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.