Skip to main content

VGridControl.LocateByValue(String, Object) Method

Returns the handle of the record that contains the specified value in the specified field.

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v23.2.dll

NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid

Declaration

public int LocateByValue(
    string fieldName,
    object val
)

Parameters

Name Type Description
fieldName String

A string that specifies the name of the field in which to search for the specified value.

val Object

An object that specifies the value to find.

Returns

Type Description
Int32

An integer value that specifies the handle of the record that contains the specified value in the specified field. The DevExpress.Data.DataController.InvalidRow field value is returned, if no record is found that matches the specified conditions.

Remarks

The code below focuses the record that contains “Rolls-Royce“ in the “Trademark“ field.

vGridControl1.FocusedRecord = vGridControl1.LocateByValue("Trademark", "Rolls-Royce");
See Also