The Binding.Format event is raised when data is pushed from the data source into the control. You can handle the Binding.Format event to convert unformatted data from the data source into formatted data for display. When data is pulled from the control into the data source, the Binding.Parse event is raised to unformat the displayed value, then the Binding.Format event occurs to reformat the data for display. This ensures that the bound control displays correctly formatted data regardless of whether the user enters formatted or unformatted data in the control.
The Binding.Format and Binding.Parse events allow you to create custom formats for displaying data. For example, if the data in a table is of type decimal, you can display the data in the local currency format by setting the ConvertEventArgs.Value property of the System.Windows.Forms.ConvertEventArgs to the formatted value in the Binding.Format event. You must consequently unformat the displayed value in the Binding.Parse event.
The first time the property is bound.
Any time the BindingManagerBase.Position changes.
Whenever the data-bound list is sorted or filtered, which is accomplished when a System.Data.DataView supplies the list.
The Binding.Format event also occurs after the Binding.Parse event. For example, when a control loses focus, its contents are parsed. Immediately afterward, as new data is pushed into the control, the Binding.Format event occurs allowing the new contents to be formatted.
For more information about handling events, see Consuming Events.