Back to Devexpress

GridViewDataColumn.UnboundExpression Property

aspnet-devexpress-dot-web-dot-gridviewdatacolumn.md

latest2.7 KB
Original Source

GridViewDataColumn.UnboundExpression Property

Gets or sets an expression used to evaluate values for the current unbound column.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue("")]
public virtual string UnboundExpression { get; set; }
vb
<DefaultValue("")>
Public Overridable Property UnboundExpression As String

Property Value

TypeDefaultDescription
StringString.Empty

An expression used to evaluate values for the current column.

|

Remarks

Set the GridViewDataColumn.UnboundType property to a specific data type to create an unbound column. Populate unbound columns in the designer or use the ASPxGridView.CustomUnboundColumnData event or the UnboundExpression property. The Expressions section describes the expression syntax.

Expressions do not allow you to save data entered by end users. For this purpose, use the ASPxGridView.CustomUnboundColumnData event to provide data for unbound fields.

Concept

Unbound Columns

Example

aspx
<dx:ASPxGridView ID="Grid" runat="server" DataSourceID="ProductsDataSource" KeyFieldName="OrderID" >
    <Columns>
        <dx:GridViewDataSpinEditColumn FieldName="UnitPrice" />
        <dx:GridViewDataSpinEditColumn FieldName="Quantity" />
        <dx:GridViewDataSpinEditColumn FieldName="Discount" />
        <dx:GridViewDataTextColumn FieldName="Total" UnboundType="Decimal" 
            UnboundExpression="UnitPrice*Quantity*(1-Discount)" />
    </Columns>
</dx:ASPxGridView>

See Also

Grid View

GridViewDataColumn Class

GridViewDataColumn Members

DevExpress.Web Namespace