Back to Devexpress

VGridControl.ShowComparison() Method

windowsforms-devexpress-dot-xtraverticalgrid-dot-vgridcontrol-ff6e547c.md

latest3.8 KB
Original Source

VGridControl.ShowComparison() Method

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

Namespace : DevExpress.XtraVerticalGrid

Assembly : DevExpress.XtraVerticalGrid.v25.2.dll

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

Declaration

csharp
public bool ShowComparison()
vb
Public Function ShowComparison As Boolean

Returns

TypeDescription
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.

csharp
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();
}
vb
Imports DevExpress.XtraVerticalGrid

Private Sub btnAddRecordsAndShowComparison_ItemClick(ByVal sender As Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs)
    ' Add records to the comparison collection.       
    vGridControl1.AddToComparison(5)
    vGridControl1.AddToComparison(7)
    ' Display the comparison
    vGridControl1.ShowComparison()
End Sub

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

AddSelectionToComparison()

HideComparison()

ClearComparison()

AllowRecordComparison

VGridControl Class

VGridControl Members

DevExpress.XtraVerticalGrid Namespace