windowsforms-devexpress-dot-xtragrid-dot-views-dot-grid-dot-calcpreviewtexteventargs-cb32ed5f.md
Gets the handle of the row whose preview text is to be generated.
Namespace : DevExpress.XtraGrid.Views.Grid
Assembly : DevExpress.XtraGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation
public int RowHandle { get; }
Public ReadOnly Property RowHandle As Integer
| Type | Description |
|---|---|
| Int32 |
An integer value representing a handle of the row whose preview text is to be generated.
|
The obtained row handle can be used, for instance, to get cell values within the currently processed row. This can be used to construct the preview text for values displayed across several fields. To obtain cell values, use the ColumnView.GetRowCellDisplayText and ColumnView.GetRowCellValue methods.
For information on row handles, refer to the Rows help topic.
This example customizes the row preview text.
using DevExpress.XtraGrid.Views.Grid;
private void gridView1_CalcPreviewText(object sender, CalcPreviewTextEventArgs e) {
GridView view = sender as GridView;
if (view == null) return;
e.PreviewText = "Item: " + e.PreviewText + "; Units: " +
view.GetRowCellDisplayText(e.RowHandle, _
view.Columns["UnitsOnOrder"]) + ".";
}
Imports DevExpress.XtraGrid.Views.Grid
Private Sub GridView1_CalcPreviewText(ByVal sender As System.Object, _
ByVal e As CalcPreviewTextEventArgs) Handles GridView1.CalcPreviewText
Dim view As GridView = sender
If view Is Nothing Then
Return
End If
e.PreviewText = "Item: " + e.PreviewText + "; Units: " + _
view.GetRowCellDisplayText(e.RowHandle, _
view.Columns("UnitsOnOrder")) + "."
End Sub
See Also
CalcPreviewTextEventArgs Class