Free Support Forum - aspose.com

ComboBox and Cell locked property

When I set a cell's locked property to true that has a combobox in it, I'm still able to select an item from the drop-down.

Is it possible to have it totally disabled where the user can not do anything with the cell?

Hi,

Well, we can support this feature, but we need to know more about your need. Which way you may prefer to protect the cell:

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

1. If the user set cell lock property to “true” by the right click menu, the user will not able to do anything with the cell except the right click menu. This means the user still can set the cell lock property to “false” by the right click menu and then modify the cell’s content.

2.Add a new attribute “IsLock” to GridCell class, if the property is set to “true” by code, the user will not able to do anything with the cell including the right click menu. This means the user can do nothing with the cell through the user interface if “IsLock” attribute is set to “true”.

Please give us more detail about your need, thank you.

I'm not allowing the user to use the context menu, so having the IsLock attribute would work for my need.

Ok. Hopefully we can support it in 2 weeks.

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you.

Hi,

We added two new features in the attached new version. Please check if this can meet your need.

1. New property GridCell.Protected. It indicates if the user can modify the cell through the user interface. The default value is "false".

2. New property ComboBox.IsInputable. It indicates if the user can input text to the combobox. The inputted text will be saved as the cell’s value. The default value is "false".

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you.

I'm trying to update the protected property to false after I've set it to true earlier.

However, it still says it's protected even though I've changed it.

Hi,

Well, I don't find the problem you mentioned. Following is my testing code which works fine:

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

sheet.Cells["F3"].Protected = true;

Console.WriteLine(sheet.Cells["F3"].Protected);//prints true

sheet.Cells["F3"].Protected = false;

Console.WriteLine(sheet.Cells["F3"].Protected);// prints false

If the problem still persists, kindly post your template file and paste your sample code here to show the issue. We will check it soon.

Thank you.