Prevent user from selecting cells

Posted by: Luis.Alvarez on 11 January 2019, 2:54 am EST

  • Posted 11 January 2019, 2:54 am EST

    Is there a way to prevent the user from selecting specific cells? I tried listed the cells that the user is allowed to access/select as .Locked = false followed by "gcSpreadSheet1.Protect = True". User is not allowed to edit the cell contents except for the ones that have the Locked property set to false. The user can still selected the locked cells and I don't want the user to be able to select the locked cells only the ones that are not "Locked".

    Thanks,
    Luis
  • Marked as Answer

    Replied 15 January 2019, 12:15 am EST

    Hi Luis,

    You can use the LeaveCell event or EnterCell event and check if the new cell is locked cell. Then you can logically set the next cell(in row/column) be active cell in code and skip the locked cell.

    https://help.grapecity.com/spread/SpreadWPF/webframe.html#GrapeCity.WPF.SpreadSheet.UI~GrapeCity.Windows.SpreadSheet.UI.GcSpreadSheet~LeaveCell_EV.html

    https://help.grapecity.com/spread/SpreadWPF/webframe.html#GrapeCity.WPF.SpreadSheet.UI~GrapeCity.Windows.SpreadSheet.UI.SheetView~EnterCell_EV.html


    Thanks,
    Deepak Sharma
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels