Completed
Last Updated: 07 Jun 2023 10:38 by ADMIN
Release R2 2023 (2023.2.606)
Johann
Created on: 26 May 2023 10:36
Category: GridView
Type: Bug Report
0
RadGridView: NullReferenceException when setting the grid's ReadOnly property with hidden GridViewCheckBoxColumn

Use the code below and click the button to make the grid ReadOnly:

        public TestForm()
        {        
            InitializeComponent(); 
          
             GridViewCheckBoxColumn checkBoxColumn = new GridViewCheckBoxColumn("checkbox");
            checkBoxColumn.EnableHeaderCheckBox = true;
            this.radGridView1.Columns.Add(checkBoxColumn);
            this.radGridView1.Columns.Add("text");
            this.Shown += TestForm_Shown;
        }

        private void TestForm_Shown(object sender, EventArgs e)
        {
            this.radGridView1.Columns["checkbox"].IsVisible = !this.radGridView1.Columns["checkbox"].IsVisible;
        }

        private void radButton1_Click(object sender, EventArgs e)
        {
           
            this.radGridView1.ReadOnly = !this.radGridView1.ReadOnly;
        }

1 comment
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 26 May 2023 11:11

Hello, Johann,

Thank you for bringing this to our attention. We will do our best to introduce a proper fix in the upcoming release scheduled for the first half of June.

Currently, the possible solution that I can suggest is to shrink the column instead of hiding it: 

 this.radGridView1.Columns["checkbox"].MaxWidth = 1; 

Make sure that you follow the item in order to get notified once any status changes occur.

Please excuse us for the inconvenience caused.

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.