How do you format TEXT in a DataGridTextBoxColumn 
Author Message
 How do you format TEXT in a DataGridTextBoxColumn

I am trying to format a field (SSNs) in a
DataGridTextBoxColumn with the following:
TextColumn.Format = "###-##-####"
This is failing because the SSNs are stored in the
database as Text (e.g. '123456789')  When I test changing
the SSN field to a numeric field it formats correctly,
but I want to keep the field as text in the database to
avoid breaking other things.

I can see in the VB.net Help how to format
DataGridTextBoxColumns with numeric or date formats but
nothing about text.

Any help would be greatly appreciated.  Thanks



Mon, 12 Jul 2004 04:17:01 GMT  
 How do you format TEXT in a DataGridTextBoxColumn
This probably isn't the answer you are looking for but you could format it
in your stored procedure.

SELECT Left(Cast(SSNumber As VarChar(9)), 3) + '-' + SubString(Cast(SSNumber
As VarChar(9)), 4, 2) + '-' + SubString(Cast(SSNumber As VarChar(9)), 6, 4)
FROM SSNumbers


Quote:
> I am trying to format a field (SSNs) in a
> DataGridTextBoxColumn with the following:
> TextColumn.Format = "###-##-####"
> This is failing because the SSNs are stored in the
> database as Text (e.g. '123456789')  When I test changing
> the SSN field to a numeric field it formats correctly,
> but I want to keep the field as text in the database to
> avoid breaking other things.

> I can see in the VB.net Help how to format
> DataGridTextBoxColumns with numeric or date formats but
> nothing about text.

> Any help would be greatly appreciated.  Thanks



Mon, 12 Jul 2004 12:51:04 GMT  
 How do you format TEXT in a DataGridTextBoxColumn

I'm still going to look for the answer to the other issue, but in the
mean time I'm going to use your answer... THANKS!!!!!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Tue, 13 Jul 2004 22:17:52 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Formatting text for a DataGridTextBoxColumn

2. Formatting string value in DataGridTextBoxColumn

3. Modifying Text Format in use without changing text in entire text box

4. Macro - Format Text / Save As HTML / Format Source

5. Binary format to text format form conversion

6. formatting a text box to long date format

7. Needed: Modul for writing formatted text to be saved in RTF - Format

8. How can I format Rich Text Format?

9. datagridtextboxcolumn editing.

10. Passing Property Descriptor to DataGridTextBoxColumn Constructor

11. Disable DataGridTextBoxColumn?

12. mousedown event of datagridtextboxColumn

 

 
Powered by phpBB® Forum Software