DataColumn Format

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

My user types 7 digit numbers into one of my datacolumns like this: 9999999
I want that to be formatted like this: 999-9999

How could I use the DataColumn->Format property so as to add the '-' in between? Or should I use some other property?

Thanks in advance,
Rakesh
 
Rakesh,

This might be a little sloppy, but you could use the Insert method of string

string strOriginalValue = strOriginalValue.Insert(nStartIndex,
strValueYouWantToInsert);

knowing this, I would go;

string strOriginalValue = strOriginalValue.Insert(3, "-");

HTH

Marco
Rakesh said:
Hi,

My user types 7 digit numbers into one of my datacolumns like this: 9999999
I want that to be formatted like this: 999-9999

How could I use the DataColumn->Format property so as to add the '-' in
between? Or should I use some other property?
 
Back
Top