Back to Devexpress

ASPxEdit.Value Property

aspnet-devexpress-dot-web-dot-aspxedit.md

latest5.2 KB
Original Source

ASPxEdit.Value Property

Gets or sets the edited value within the editor.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public override object Value { get; set; }
vb
Public Overrides Property Value As Object

Property Value

TypeDescription
Object

A Object value representing the editor’s edited value.

|

Remarks

Use the Value property to access the value currently edited within the editor. The value type varies for different editor controls. Since all classes are Object descendants, any class can be returned by this property.

If you need to validate the editor’s value before posting it, you can handle either client-side ASPxClientEdit.Validate or server-side ASPxEdit.Validate events, or both. If no validation is performed and the value posted is not correct (for instance, a number value is posted to a DateTime field), then an exception is raised.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Value property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

asp-net-web-forms-editors-create-registration-form/CS/ASPxEditorsTutorial.Step4/RegistrationForm.aspx.cs#L26

csharp
command.Parameters.AddWithValue("lastName", lastNameTextBox.Text);
command.Parameters.AddWithValue("gender", genderRadioButtonList.Value);
command.Parameters.AddWithValue("birthDate", birthDateEdit.Date.ToShortDateString());

asp-net-web-forms-scheduler-custom-adaptive-form-using-templates/CS/WebApplication1/DevExpress/ASPxSchedulerForms/AppointmentForm.ascx.cs#L220

csharp
string stringResourceNone = SchedulerLocalizer.GetString(SchedulerStringId.Caption_ResourceNone);
ddResource.Value = stringResourceNone;
if(multiResourceString.Count > 0)

asp-net-web-forms-grid-set-edit-form-values/CS/Solution/ServerSide.aspx.cs#L23

csharp
totalEditor.Value = Convert.ToDecimal(unitPriceEditor.Value) * Convert.ToDecimal(unitsInStockEditor.Value);
}

asp-net-web-forms-editors-create-registration-form/VB/ASPxEditorsTutorial.Step4/RegistrationForm.aspx.vb#L25

vb
command.Parameters.AddWithValue("lastName", lastNameTextBox.Text)
command.Parameters.AddWithValue("gender", genderRadioButtonList.Value)
command.Parameters.AddWithValue("birthDate", birthDateEdit.Date.ToShortDateString())

asp-net-web-forms-scheduler-custom-adaptive-form-using-templates/VB/WebApplication1/DevExpress/ASPxSchedulerForms/AppointmentForm.ascx.vb#L228

vb
Dim stringResourceNone As String = SchedulerLocalizer.GetString(SchedulerStringId.Caption_ResourceNone)
ddResource.Value = stringResourceNone
If multiResourceString.Count > 0 Then

asp-net-web-forms-grid-set-edit-form-values/VB/Solution/ServerSide.aspx.vb#L25

vb
Dim totalEditor As ASPxTextBox = CType(grid.FindEditRowCellTemplateControl(CType(grid.Columns("Total"), GridViewDataColumn), "TotalEditor"), ASPxTextBox)
    totalEditor.Value = Convert.ToDecimal(unitPriceEditor.Value) * Convert.ToDecimal(unitsInStockEditor.Value)
End Sub

See Also

ASPxEdit Class

ASPxEdit Members

DevExpress.Web Namespace