kpgraci
Active member
I have a window form with a label.
On the form I have a dataset, bindingsoure, and tableadaptor (all created by the IDE in response to binding the text property of the label)
To fill the datatable, the IDE created this:
Works fine.
The bound field is a phone number, stored in the db as a 10 digit numeric string
I need to format this with the standard ()-, and I have a function that will do just that.
How can I apply the formatting so the phone number appears in the label properly?
EDIT:
In the Advanced section of the databinding property of the label control, under custom formatting there is a disclaimer:
This seems promising... How to I handle the format event for the binding???
On the form I have a dataset, bindingsoure, and tableadaptor (all created by the IDE in response to binding the text property of the label)
To fill the datatable, the IDE created this:
VB.NET:
[FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][COLOR=#000000]Me.ClientsTableAdapter.Fill([/COLOR][/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2][COLOR=#000000].MyDataSet.Clients)[/COLOR][/SIZE][/FONT][/SIZE][/FONT]
Works fine.
The bound field is a phone number, stored in the db as a 10 digit numeric string
I need to format this with the standard ()-, and I have a function that will do just that.
How can I apply the formatting so the phone number appears in the label properly?
EDIT:
In the Advanced section of the databinding property of the label control, under custom formatting there is a disclaimer:
VB.NET:
In order to ensure that a custom-formatted value successfully displays in the control and is persisted to the database, handle the parse or format event for the binding.
This seems promising... How to I handle the format event for the binding???
Last edited: