Skip to main content

dxForm

Namespace: Wisej.Web.Ext.DevExtreme

Assembly: Wisej.Web.Ext.DevExtreme (4.1.0.0)

The Form widget represents fields of a data object as a collection of label-editor pairs.

public class dxForm : dxBase

Constructors​

Instance member dxForm()​

Constructs a new instance of the dxForm class.

Example:

The following example creates a form that generates an editor for each field of the data object.

var form = new dxForm();
form.Options.formData = new { firstName = "John", lastName = "Heart", email = "jheart@example.com" };
form.Options.colCount = 2;
form.Options.labelLocation = "top";
form.Dock = DockStyle.Top;
this.Controls.Add(form);

Instance member dxForm(options)​

Constructs a new instance of the dxForm class.

NameTypeDescription
optionsObjectInitial set of options.

Example:

The following example creates a form with a custom list of items and receives the values edited by the user.

var form = new dxForm(new
{
formData = new { name = "Anna Smith", phone = "", notes = "" },
items = new object[]
{
"name",
new { dataField = "phone", label = new { text = "Mobile phone" } },
new { dataField = "notes", editorType = "dxTextArea" }
}
});
form.Instance.onFieldDataChanged += new WidgetEventHandler((s, e) =>
{
AlertBox.Show($"{e.Data.dataField} = {e.Data.value}");
});
form.Dock = DockStyle.Top;
this.Controls.Add(form);

Implements​