This is a migrated thread and some comments may be shown as answers.

ReadOnly GridViewCheckBoxColumn

9 Answers 575 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mel Grubb
Top achievements
Rank 2
Mel Grubb asked on 07 Jul 2009, 03:31 PM
I have a check box column in a RadGridView, and I can't seem to make it read only.  I've searched through the forums, and only found people with the opposite problem.  I've seen posts about people with read only grids where they want one column editable.  What I want is a checkbox column that is NOT editable, but try as I might, you can edit the check boxes in this grid.

I set the grid's ReadOnly property to True.
I set the individual column's ReadOnly property to True.
I set the grid's AllowEditRow to False.
I even set the grid's BeginEditMode property to BeginEditProgrammatically.

Nothing has any effect.  What do I have to do to make a simple read-only grid?

9 Answers, 1 is accepted

Sort by
0
Ben
Top achievements
Rank 1
answered on 08 Jul 2009, 12:03 AM
I am having the same problem. If I set everything to readonly (like you mention) the CellBeginEdit event isn't fired, but you can still change the state of the checkbox by clicking on it.

Please help!
0
Jack
Telerik team
answered on 08 Jul 2009, 11:39 AM
Hi Mel Grubb,

I confirm that this is an issue. We are aware of it and it will be addressed in our upcoming service pack. You can set the Enabled property to false when handling the CellFormatting event:

void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e) 
    if (e.CellElement is GridCheckBoxCellElement) 
    {      
        RadCheckBoxEditorElement checkboxElement = e.CellElement.Children[0] as RadCheckBoxEditorElement; 
        checkboxElement.UseDefaultDisabledPaint = false
        checkboxElement.Enabled = false
    } 

Remove the UseDefaultDisabledPaint line and the checkbox will appear as disabled.

If you need further assistance, please write us back.

Best wishes,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Ben
Top achievements
Rank 1
answered on 08 Jul 2009, 10:18 PM
This has solved my problem - thanks. I look forward to a bug fix however. When is SP1 due out?
0
Jack
Telerik team
answered on 09 Jul 2009, 02:32 PM
Hi Ben,

Currently we collect issues to address in the service pack. It will be released in 2-3 weeks from now. There is an internal build that addresses the checkbox issue. Please open a support ticket and I will send it to you. I am looking forward to your reply.

Sincerely yours,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Ben
Top achievements
Rank 1
answered on 10 Jul 2009, 12:18 AM
The work around is ok for now - I would rather stick to major releases as it means I don't have to update my repositories and release builds.
0
Mel Grubb
Top achievements
Rank 2
answered on 10 Jul 2009, 04:21 PM
I will stick with the workaround as well for the moment.
0
Vassil Petev
Telerik team
answered on 03 Aug 2009, 12:46 PM
Hello guys,

This is to let you know that we releases SP1 last week. Feel free to give it a try and check how the fix works.

Greetings,
Vassil
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jeroen Eikmans
Top achievements
Rank 1
answered on 13 Sep 2010, 12:42 PM
I'm having the same problem as described above but I'm using version 2010.2.10.806 of the Telerik.WinControls assembly.

The grid has AllowEditRow set to true and BeginEditMode has been set to BeginEditProgrammaticaly.
The grid has a GridViewCheckBoxColumn and the ReadOnly property has been set to true.

With this configuration i can still change the checkbox even without calling grid.BeginEdit().

I've used the workaround as described in the thread and that does work but in my opinion changing the checkbox should only be possible after the BeginEdit method has been called.
With the workaround i have to build the logic that when in EditMode the checkbox may be changed and otherwise not.

Any advice or do i have to set some specific properties for the checkbox?

Kind regards.
0
Jack
Telerik team
answered on 16 Sep 2010, 03:13 PM
Hi Roel Martens,

I confirm that the issue is introduced in our latest release and the described work around is the proper way to solve it. I can assure you that the issue will be addressed in our next major release - Q3 2010. I updated your Telerik points for this issue report.

If you have other questions, please write back.

Sincerely yours,
Jack
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Mel Grubb
Top achievements
Rank 2
Answers by
Ben
Top achievements
Rank 1
Jack
Telerik team
Mel Grubb
Top achievements
Rank 2
Vassil Petev
Telerik team
Jeroen Eikmans
Top achievements
Rank 1
Share this question
or