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 2016-07-21 07:36:36

mtdlmt
Member
Registered: 2016-07-21
Posts: 1

Read-only checkbox

I searched the forum and haven't found solution to this problem.

How to make the checkbox cell read-only? the one which you cannot check or uncheck.

I tried setting the cell to read-only but you can still check/uncheck the checkbox.
Is there any way to do this?

Offline

#2 2016-07-22 11:05:59

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

Re: Read-only checkbox

It's a problem, checkbox and radio buttons should be disabled when cell is read-only.

You can use a customized checkbox inherited from the built-in one.

class MyCheckboxCell : CheckBoxCell
{
	public override void ToggleCheckStatus()
	{
		if (this.Cell != null && this.Cell.IsReadOnly) return;

		base.ToggleCheckStatus();
	}
}

Then use it in your worksheet:

sheet["A1"] = new MyCheckboxCell();
sheet.Cells["A1"].IsReadOnly = true;

Offline

Board footer

Powered by FluxBB