officefileapi-devexpress-dot-spreadsheet-dot-cellrange-dot-isintersecting-x28-devexpress-dot-spreadsheet-dot-cellrange-x29.md
Determines whether the current range intersects with the specified range.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
bool IsIntersecting(
CellRange other
)
Function IsIntersecting(
other As CellRange
) As Boolean
| Name | Type | Description |
|---|---|---|
| other | CellRange |
A cell range to be checked.
|
| Type | Description |
|---|---|
| Boolean |
true if ranges intersect; otherwise, false.
|
Use the CellRange.Intersect method to get the intersection of cell ranges.
To check whether a cell range contains another range, use the CellRange.Contains method.
The following code snippets (auto-collected from DevExpress Examples) contain references to the IsIntersecting(CellRange) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
// display a dialog requesting the user to confirm the deletion of records.
if (boundRange.IsIntersecting(rowRange))
{
winforms-spreadsheet-bind-to-ms-sql-server-database/CS/SuppliersExample/Form1.cs#L94
// display a dialog requesting the user to confirm the deletion of records.
if (boundRange.IsIntersecting(rowRange)) {
DialogResult result = MessageBox.Show("Want to delete the selected supplier(s)?", "Delete",
winforms-spreadsheet-use-custom-cell-editors/CS/DevAVInvoicing/Form1.cs#L118
DefinedName invoiceItems = sheet.DefinedNames.GetDefinedName("InvoiceItems");
btnRemoveRecord.Enabled = invoiceItems != null && invoiceItems.Range.RowCount > 1 && invoiceItems.Range.IsIntersecting(sheet.SelectedCell);
}
winforms-spreadsheet-custom-draw-example/CS/WindowsFormsApp1/Form1.cs#L121
var dataRange = e.Cell.Worksheet.GetDataRange();
if (e.Cell.IsIntersecting(dataRange) && e.Cell.RowIndex % 2 != 0)
{
' display a dialog requesting the user to confirm the deletion of records.
If boundRange.IsIntersecting(rowRange) Then
Dim result As MessageBoxResult = MessageBox.Show("Want to delete the selected supplier(s)?", "Delete", MessageBoxButton.YesNo, MessageBoxImage.Question)
winforms-spreadsheet-bind-to-ms-sql-server-database/VB/SuppliersExample/Form1.vb#L90
' display a dialog requesting the user to confirm the deletion of records.
If boundRange.IsIntersecting(rowRange) Then
Dim result As DialogResult = MessageBox.Show("Want to delete the selected supplier(s)?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
winforms-spreadsheet-use-custom-cell-editors/VB/DevAVInvoicing/Form1.vb#L109
Dim invoiceItems As DefinedName = sheet.DefinedNames.GetDefinedName("InvoiceItems")
btnRemoveRecord.Enabled = invoiceItems IsNot Nothing AndAlso invoiceItems.Range.RowCount > 1 AndAlso invoiceItems.Range.IsIntersecting(sheet.SelectedCell)
Else
winforms-spreadsheet-custom-draw-example/VB/CustomDrawExample/Form1.vb#L214
Dim dataRange = e.Cell.Worksheet.GetDataRange()
If e.Cell.IsIntersecting(dataRange) AndAlso e.Cell.RowIndex Mod 2 <> 0 Then
e.BackColor = Color.FromArgb(50, 91, 155, 213)
See Also