Back to Devexpress

ASPxGridColumnDataEventArgs.Value Property

aspnet-devexpress-dot-web-dot-aspxgridcolumndataeventargs-fef2fb84.md

latest4.5 KB
Original Source

ASPxGridColumnDataEventArgs.Value Property

Gets or sets the value of the cell currently being processed.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

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

Property Value

TypeDescription
Object

An object that represents the currently processed cell’s value.

|

Remarks

If the ASPxGridColumnDataEventArgs.IsGetData property returns true (and consequently, the ASPxGridColumnDataEventArgs.IsSetData property returns false) the ASPxGridView.CustomUnboundColumnData event handler should provide data for the cell currently being processed. You need to obtain the data for this cell from a custom data source and assign it to the Value property.

The processed unbound column is identified by the ASPxGridViewColumnDataEventArgs.Column property. The ASPxGridColumnDataEventArgs.ListSourceRowIndex property can be used to identify the current row.

If the ASPxGridColumnDataEventArgs.IsGetData property returns false (and consequently, the ASPxGridColumnDataEventArgs.IsSetData property returns true) the ASPxGridView.CustomUnboundColumnData event handler should store the Value property’s value to the data source.

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-grid-set-edit-form-values/CS/Solution/ClientSide.aspx.cs#L12

csharp
int quantity = Convert.ToInt32(e.GetListSourceFieldValue("UnitsInStock"));
    e.Value = price * quantity;
}

asp-net-web-forms-grid-editable-unbound-columns/CS/UnboundColumnForCommenting/Default.aspx.cs#L41

csharp
object key = e.GetListSourceFieldValue(e.ListSourceRowIndex, ASPxGridView1.KeyFieldName);
    e.Value = MyComments.GetComment(key);
}

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

vb
Dim quantity As Integer = Convert.ToInt32(e.GetListSourceFieldValue("UnitsInStock"))
    e.Value = price * quantity
End If

asp-net-web-forms-grid-editable-unbound-columns/VB/UnboundColumnForCommenting/Default.aspx.vb#L38

vb
Dim key As Object = e.GetListSourceFieldValue(e.ListSourceRowIndex, ASPxGridView1.KeyFieldName)
    e.Value = GetComment(key)
End If

See Also

ASPxGridColumnDataEventArgs Class

ASPxGridColumnDataEventArgs Members

DevExpress.Web Namespace