CellLocked vs. Protected

If I have a cell with a combobox and I set the style.celllocked property to true, the user is still able to select an item from the drop-down.

The only way to prevent this is to set the protected property to true. However, even the cell is “locked”, I do want the user to be able to double-click the cell and then I’ll perform some action.

This isn’t possible if protected is set to true for that cell.

Any ideas on how to allow the user to double-click a cell but at the same time, not allow them to change a value and select a value from a combobox?

Hi,

sswift:
Any ideas on how to allow the user to double-click a cell but at the same time, not allow them to change a value and select a value from a combobox?

Well, it works if you use Cell.Protected = true. I tested it with the following code, the GridDesktop's CellDoubleClick event is fired double clicking on a cell (that has the combo box control).

Sample code:

Dim sheet As Aspose.Grid.Desktop.Worksheet = grdDataEntry.Worksheets(0)

Dim cell As Aspose.Grid.Desktop.GridCell = sheet.Cells("B1")

cell.Value = "Hello..."

Dim items() As String = New String(5) {}

items(0) = "Aspose"

items(1) = "Aspose.Grid"

items(2) = "Aspose.Cells"

items(3) = "Aspose.Pdf"

items(4) = "Aspose.Slides"

sheet.Controls.AddComboBox(0, 1, items)

cell.Protected = True

By the way I use the latest fix 2.0.0.32.

Thank you.