Introduction
Management
Technology
ISO9001
About us
Copyright
colourful technology...
Dyetech
October 19th 2005

Numbers on DataGrids

Display numbers on Datagrids - shouldn't be difficult at all should it? In fact the Format property of a column lets you set the number format. But beware of percentages (see here - the advantage of hindsight!).

Also, unfortunately, display is only half the issue - if the Datagrid is also to be used for input then the problem becomes more difficult; as unlike databinding there are no parse and format functions you can intercept. Finally the issue of handling null entries in a grid requires coding. After all what is a null value (nothing in VB) when displaying a number?

The answer seems to be to write a new column class sub-classing the DataGridTextBoxColumn - and providing data transfer routines that are null aware.

 

Comments? - Contact us here


Home
IT and Management consultancy
Copyright Dyetech 2005-7
All rights reserved