Skip to main content
All docs
V24.2

VGridControl.ShowComparison() Method

Displays the selected records in a side-by-side comparison

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v24.2.dll

Declaration

public bool ShowComparison()

Returns

Type Description
Boolean

true if the comparison is displayed; otherwise, false

Remarks

The VGridControl allows you to compare records if the AllowRecordComparison property is set to true.

The ShowComparison method displays the records that were added to the comparison.

To add records to the comparison, use one of the following actions:

Example

The following example uses the AddToComparison method to add records to the comparison collection, and the ShowComparison method to display the comparison.

using DevExpress.XtraVerticalGrid;

private void btnAddRecordsAndShowComparison_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { 
    // Add records to the comparison collection.
    vGridControl1.AddToComparison(5);
    vGridControl1.AddToComparison(7);
    // Display the comparison.
    vGridControl1.ShowComparison();
}

To get the indices of the records in the comparison, use the GetComparisonRecords method.

The HideComparison method hides the comparison. To clear the comparison collection, use the ClearComparison method.

See Also