Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting column in datagrid

Status
Not open for further replies.

MarcusO

IS-IT--Management
Mar 28, 2001
13
0
0
AU
Hello,

I am trying to format a column containing numerical values in a datagrid nicely. So therefore I have applied this custom format to the column:

myColumn.Format = "#,#" (which inserts a thousand separator)

The column is bound to a dataset and the datatype for my nicely formatted column does not like thousand separator and hence it does not accept the value unless the user keys in the value without the separator.

The questions is how do I format the column so I still can store it in the database without troubles?

Regards,
Marcus
 
You have one of two choices. First, change your database field to play nicely with your seperator.

If that's not an option, then you'll need to switch to an unbound datagrid and manually add/remove/update entries from within your code.

There may be another option available, but it's late and I can't think of any more :)
 
Cool. I was hoping it was possible to add some sort of event to the grid or dataset and then, just before the dataset accepts the data, remove the thousand separator.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top