Last Updated: 27 Mar 2023 06:39 by ADMIN
Release R1 2023 SP1
Created on: 17 Jan 2023 14:03
Category: VirtualGrid
Type: Bug Report
RadVirtualGrid: VirtualGridSelection.HasSelection is never false.

RadVirtualGrid.Selection.HasSelection (VirtualGridSelection.HasSelection) or is never false.

RadVirtualGrid grid = new RadVirtualGrid();
var hasSelection1 = grid.Selection.HasSelection; 
var hasSelection2 = grid.Selection.HasSelection;

After initializing the grid, and not loading anything, HasSelection is true, while nothing is selected.

After clearing the selection, HasSelection remains true.

This property is used in your own code as a pretest for some operations. (Like Copy or Cut).

Am I interpreting this property the wrong way?

1 comment
Dess | Tech Support Engineer, Principal
Posted on: 20 Jan 2023 12:02

Hi, Martin,

After clearing the selection in RadVirtualGrid, the SelectedRegion has the following value:

The Empty region doesn't have a value for the ViewInfo:

That is why the property always returns true:

        /// <summary>
        /// Gets a value indicating whether there are selected cells.
        /// </summary>
        public bool HasSelection
            get { return this.CurrentViewInfo != null && this.SelectedRegion != SelectionRegion.Empty; }

I have approved this item.

I have also updated your Telerik points.

Dess | Tech Support Engineer, Principal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at