Locked property does not work

Posted by: haidvcntt2 on 24 March 2019, 8:37 pm EST

    • Post Options:
    • Link

    Posted 24 March 2019, 8:37 pm EST

    1. I use FarPoint.Win.Spread.FpSpread, FarPoint.Win.Spread, Version=12.45.20181.0
    2. I set locked for column 0, Set CellType of column 0 is Empty and readonly true
    3. When i use keyboard ctrl +X or shift + Delete for data of column 0 then column 0 will clear data Although column set locked is true.
    4. I want use good property locked of cell?
    5. Below is my sample lesson.

      Thank you
  • Posted 25 March 2019, 10:41 pm EST

    Hello,

    Here is the code to set Column[0,2] i.e. initial 3 columns locked in a Spread control:-

     fpSpread1.ActiveSheet.Protect = true;
                FarPoint.Win.Spread.Column col;
                int i, j;
                col = fpSpread1.ActiveSheet.Columns[0, 2];
                col.Locked = true;
                for (i = 0; i <= col.Index2; i++)
                {
                    for (j = 0; j <= fpSpread1.ActiveSheet.RowCount - 1; j++)
                        fpSpread1.ActiveSheet.Cells[j, i].Text = "Locked";
                }
        
                FarPoint.Win.Spread.Column col1;
                col1 = fpSpread1.ActiveSheet.Columns[3, fpSpread1_Sheet1.ColumnCount-1];
                col1.Locked = false;
    

    Hope it helps.

    Thanks,

    Reeva

Need extra support?

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

Learn More

Forum Channels