Format Column in Datagrid Tablestyle Collection

Moishe

Member
Joined
May 30, 2003
Messages
24
Hi All
I have a column (Time) in the tablestyle collection I want to format it to "00:00" when user enter 1100 it woud format it to 11:00 and also validate if it is a valid input?

I tried doing it in the designer propeties for the format something like format: "00:00"
but it didnt work.

Thanks for your help.
 
Moishe

1. Declaration:
Code:
Dim colTime As New DataGridTextBoxColumn()
2.Mapping and Formatting
Code:
colTime.Mapping = "Time"
colTime.Format = "HH:MM"
3. Add to the DataGrid
Code:
MyDataGrid.TableStyles(0).GridColumnStyles.Add()

I think these are the core elements of what you need to do, but I havent tested the "HH:MM" bit.

georg
 
Back
Top