VGridControl.ShowComparison() Method
Displays the selected records in a side-by-side comparison
Namespace: DevExpress.XtraVerticalGrid
Assembly: DevExpress.XtraVerticalGrid.v24.1.dll
NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid
Declaration
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:
- Tick the checkboxes in record headers.
- Right-click a record header and choose Add to Comparison from the context menu.
- Use the AddToComparison method, and the AddSelectionToComparison method.
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.