Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Datagrid Alignment

1 view
Skip to first unread message

Andy Baker

unread,
Oct 8, 2008, 4:00:40 AM10/8/08
to
My VB.NET 2005 application a datagrid and would like to be able to
right-align numeric fields, as I can in the full framework. I have read
elsewhere that I need CompactFramework 2, Service Pack 2 to do this, so I
have installed it on my device. The DataGridTextBoxColumn now has an Format
property (which I don't think it had before), but there is no Alignment
property. Am I doing something wrong, or is there another way of doing it
(overriding Paint somehow)? Thanks in advance.

Andy Baker


Rüdiger Kardel

unread,
Oct 8, 2008, 1:02:24 PM10/8/08
to
Andy,

the Datagrid is very compact in CF.

You can use a 3rd party product like SmartGrid from Resco (
http://www.resco.net/developer/mobileformstoolkit/overview.aspx )

or a dirty little trick:
You have to PadLeft the appropriate quantity of blanks to your values.
All digits have the same width, 2 blanks have the same width as one digit.
So you have to add 2 blanks for each missing digit.
That's not perfect, but more than nothing.

HTH
Ruediger

"Andy Baker" <aba...@NOSPAMvanputer.com> schrieb im Newsbeitrag
news:uLmdnbsSePQg-nHV...@posted.plusnet...

Kevin Matthews

unread,
Oct 9, 2008, 7:10:05 PM10/9/08
to
depending on the number of columns, you can fudge it with a list view.

Kevin

Andy Baker

unread,
Oct 10, 2008, 4:25:43 AM10/10/08
to
Thanks for that. Unfortunatley, the Resco Smartgrid is not available
separately, so buying the full set of controls is rather expensive for our
purpose. I think I will do as you suggested and use the 'dirty little trick'

Andy

"Rüdiger Kardel" <rka...@nospam.arcornews.de> wrote in message
news:gcj041...@news.kardel.org...

0 new messages