Skip to main content
A newer version of this page is available. .
Tab

GridViewDataColumn.FieldName Property

Gets or sets the name of the database field assigned to the current column.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.2.dll

Declaration

[DefaultValue("")]
public virtual string FieldName { get; set; }

Property Value

Type Default Description
String String.Empty

A String value that specifies the name of a data field.

Remarks

To specify the text which is displayed within the column’s header, use the Caption property.

It is not allowed to set the FieldName property of several columns to the same data source’s field. The FieldName property should be set to a unique value.

For unbound columns, the FieldName should not refer to any field in ASPxGridView’s data source. Refer to the Unbound Columns topic for more information.

Example

The code sample below demonstrates how you can use the ASPxTrackBar control to specify a filter condition for the ASPxGridView control.

Handle the ASPxClientTrackBar.PositionChanging event to update label content that displays the currently selected range. The ASPxClientTrackBar.PositionChanged event handler applies the specified filter to the grid by using the ASPxClientGridView.ApplyFilter method. Note that the ASPxTrackBar.ValueChangedDelay property specifies the time interval between when a user changes the editor’s value and when the filter is applied.

The image below shows the result.

TrackBar_Grid

function initLbRange() {
     lbRange.SetText('$' + tbSale.GetPositionStart() + ',000 - $' + tbSale.GetPositionEnd() + ',000');
     updateGrid();
};

function updateLbRange(s, e) {
     lbRange.SetText('$' + e.newPositionStart + ',000 - $' + e.newPositionEnd + ',000');
};

function updateGrid() {
     var filterCondition = "[Sale] > " + tbSale.GetPositionStart() * 1000 
     + " AND [Sale] < " + tbSale.GetPositionEnd() * 1000;
     grid.ApplyFilter(filterCondition);
};

The following code snippets (auto-collected from DevExpress Examples) contain references to the FieldName 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.

See Also