windowsforms-devexpress-dot-xtraverticalgrid-dot-vgridcontrol-ff6e547c.md
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
public bool ShowComparison()
Public Function ShowComparison As Boolean
| Type | Description |
|---|---|
| Boolean |
true if the comparison is displayed; otherwise, false
|
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:
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();
}
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