Completed
Last Updated: 12 Nov 2020 11:46 by ADMIN
Release R1 2021 (LIB 2020.3.1116)
Michael
Created on: 23 Oct 2020 06:02
Category: GridView
Type: Bug Report
0
RadGridView: header checkbox shouldn't be toggled when the column or the entire grid is ReadOnly

To reproduce:

1. Bind a RadGridView to the Northwind.Products table

2. Enable the header checkbox for the Discontinued column

3. Set the ReadOnly property either for the grid or for the specific column.

The header checkbox is not allowed to be toggled. However, you can toggle/untoggle it which affects all the data rows.

1 comment
ADMIN
Dess | Tech Support Engineer, Sr.
Posted on: 23 Oct 2020 06:18

Hi,

The possible solution that I can suggest in order to disable toggling the header checkbox is to set the GridViewCheckBoxColumn.ShouldCheckDataRows property to false and handle the ViewCellFormatting event where you can disable mouse handling of the checkbox: 

        private void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
        {
            GridCheckBoxHeaderCellElement cell = e.CellElement as  GridCheckBoxHeaderCellElement;
            if (cell != null)
            {
                cell.CheckBox.ShouldHandleMouseInput = false;
            }
        }

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
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 https://learn.telerik.com/.