TemplateControlBind Method

This is used to bind controls to the row source. Derived controls must override this to provide data binding support even if they contain no bound controls.

Definition

Namespace: EWSoftware.ListControls
Assembly: EWSoftware.ListControls (in EWSoftware.ListControls.dll) Version: 2023.4.9.0
protected virtual void Bind()

Remarks

This will not be called until the template is scrolled into view. This saves time and resources during the initial startup phase of a form that contains a data list control. Templates are re-bound under many conditions. If adding bindings to controls manually, be sure to clear the DataBindings collection on all bound controls first. A better alternative is to use the overloaded AddBinding(Control, String, String) method as it will take care of that for you.

Example

C#
protected override void Bind()
{
    this.AddBinding(txtFName, "Text", "FirstName");
    this.AddBinding(txtLName, "Text", "LastName");
    this.AddBinding(txtAddress, "Text", "Address");
    this.AddBinding(txtCity, "Text", "City");
    this.AddBinding(cboState, "SelectedValue", "State");
    this.AddBinding(txtZip, "Text", "Zip");
    this.AddBinding(udcSumValue, "Text", "SumValue");
}

Exceptions

NotImplementedExceptionThis is thrown if the method is not overridden and the base implementation is called.

See Also