The following code demonstrates a GridView.CalcRowHeight event handler.
This event is used to specify heights of individual rows. It is assumed that a View (gridView1) displays data from the DataView data source, which contains the RowHeight column. This column specifies the height to set for a specific row.
using DevExpress.XtraGrid.Views.Grid;
private void gridView1_CalcRowHeight(object sender, RowHeightEventArgs e) {
GridView view = sender as GridView;
if (view == null) return;
if(e.RowHandle >= 0)
e.RowHeight = (int)view.GetDataRow(e.RowHandle)["RowHeight"];
}
Imports DevExpress.XtraGrid.Views.Grid
Private Sub GridView1_CalcRowHeight(ByVal sender As Object, _
ByVal e As RowHeightEventArgs) Handles GridView1.CalcRowHeight
Dim view As GridView = sender
If view Is Nothing Then
Return
End If
If e.RowHandle >= 0 Then
e.RowHeight = view.GetDataRow(e.RowHandle)("RowHeight")
End If
End Sub