TemplateControlChangePolicyModified Method
This can be overridden to handle modifications in the change policy in the parent
DataList
control.
Namespace: EWSoftware.ListControlsAssembly: EWSoftware.ListControls (in EWSoftware.ListControls.dll) Version: 2023.4.9.0
protected virtual void ChangePolicyModified()
Protected Overridable Sub ChangePolicyModified
protected:
virtual void ChangePolicyModified()
abstract ChangePolicyModified : unit -> unit
override ChangePolicyModified : unit -> unit
The base class implementation does nothing. You can override this in derived template
controls so that they can handle modifications in the change policy such as disabling editable
controls when edits are disabled, etc. Overriding this method saves you from hooking up an event
handler in the template. This method is only called on controls that have been initialized and bound
when the change policy is modified in the parent DataList control.
// Enable or disable the controls based on the edit policy.
protected override void ChangePolicyModified()
{
if(this.TemplateParent.AllowEdits != txtFName.Enabled && !this.IsNewRow)
txtFName.Enabled = txtLName.Enabled = txtAddress.Enabled =
txtCity.Enabled = cboState.Enabled = txtZip.Enabled =
this.TemplateParent.AllowEdits;
}
' Enable or disable the controls based on the edit policy.
Protected Overrides Sub ChangePolicyModified()
Dim allowEdits As Boolean = Me.TemplateParent.AllowEdits
If allowEdits <> txtFName.Enabled And Me.IsNewRow = False Then
txtFName.Enabled = allowEdits
txtLName.Enabled = allowEdits
txtAddress.Enabled = allowEdits
txtCity.Enabled = allowEdits
cboState.Enabled = allowEdits
txtZip.Enabled = allowEdits
End If
End Sub
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.