ReoGrid Forum

Fast and powerful .NET Spreadsheet Component

You are not logged in.

Announcement

This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.

https://github.com/unvell/ReoGrid/issues

#1 2014-12-07 03:33:25

asparatu
Member
Registered: 2014-08-20
Posts: 196

How to Deselect a Hightlighted Range

I wanted to know how to do deselect a highlighted range after i select it?

Here is the code i am using:

  If e.Modifiers = Keys.Control AndAlso e.KeyCode = Keys.A Then
            If rgDataGatheringControlContainer.Name = Me.ActiveControl.Name Then
                rgDataGatheringControl.SelectRange(2, 1, 32, 2)
            End If
            nonNumberEntered = True
            Exit Sub
        End If

I have tried to use object.RemoveHighlightRange(range) and object.RemoveAllHighlightRanges() and both do not do what i want.. is there a way to just to deselect all?

Shane

Offline

#2 2014-12-08 02:20:48

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: How to Deselect a Hightlighted Range

Hi Shane,

You want to hide the focus selection range?
By default the focus selection range cannot be hidden, unless set the SelectionMode to None.

This is focus selection range, by default it cannot be hidden.
168.png

When set the SelectionMode to None, it will disappear.
VB:

worksheet.SelectionMode = ReoGridSelectionMode.None

To restore it, set the SelectionMode back to Range:
VB:

worksheet.SelectionMode = ReoGridSelectionMode.Range

This is a highlight range, it's another feature than focus selection range. (It's an hidden feature was designed to support the formula editor in future version)
167.png

To add a highlight range:
VB:

'Add highlight range
Dim refRange = worksheet.AddHighlightRange(New ReoGridRange("B2:D3"))

'Change highlight range color
refRange.HighlightColor = System.Drawing.Color.Blue

But I just found a bug in v0.8.8 with the SelectionMode = None, I will fix it.

Last edited by Jingwood (2014-12-08 02:21:18)

Offline

Board footer

Powered by FluxBB