Can't get actual cell locked status

Posted by: grapecity on 23 October 2018, 7:40 am EST

    • Post Options:
    • Link

    Posted 23 October 2018, 7:40 am EST

    When creating a spread, I lock a column by default. When I check a cell in that column later (in the base class, by iterating over all cells) I use the following:

                bool bCellLocked = this->Sheets->default[iSheet]->Cells->default[iRow, iCol]->Locked;
                bool bColLocked = this->Sheets->default[iSheet]->Columns->default[iCol]->Locked;
                bool bRowLocked = this->Sheets->default[iSheet]->Rows->default[iRow]->Locked;
    

    It initially returns:

    bCellLocked = false

    bColLocked = true

    bRowLocked = false

    Some cells in that column may have been unlocked based upon different settings in the grid, like the status of a checkbox. The issue is that locking a whole column doesn’t affect the status of the Cells->default[iRow, iCol], so I don’t always get the true status of the cell.

    I have tried

    this->Sheets->default[iSheet]->Models->Style->GetCompositeInfo(iRow, iCol, -1, styleCellInfo)->Locked
    

    but the compiler does not recognize the “Locked” property. The only options are LockBackColor, LockFont, and LockForeColor.

    Thank you for your help.

  • Posted 23 October 2018, 10:39 pm EST

    Hello,

    Actually, changing the column property does not change the cell property. In code its always retain the original value unless changed explicitly.

    Hope it clarifies.

    Thanks,

  • Posted 24 October 2018, 2:24 am EST

    Mohitg,

    That’s what I’ve gathered through my use. Is there any way to find out the actual lock status of a cell? If the column was set as locked, but I check a cell in that column, it says the cell is unlocked.

    Evan

  • Posted 24 October 2018, 6:15 pm EST

    Hello,

    There is no way to get the cell actual lock status when you locked the whole column. You need to set the locked property for each cell to get the actual status.

    Thanks,

Need extra support?

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

Learn More

Forum Channels