Click the header to pop up the menu, give a name to the column or row, then according to the column name and row name for batch modify cells.
This component is implemented based on the ongetrowheadertext and ongetcolheadertext interfaces.
function:
1.Realize mark of header with popup menu.
2.Save marks of header to file;
3.Load marks of header from file;
4.can prohibit duplicate mark
5.Can hide marked popup menu item.
demo:
var
fRowIndex, fColIndex: integer;
fRow, fCol: integer;
fcell: PCell;
...
begin
for fRowIndex:=0 to LxmHeaders1.RowHeaderItems.Count-1 do
begin
fRow := ExcelRow2Fps(StrToInt(LxmHeaders1.RowHeaderItems.Names[fRowIndex]));
fItem := LxmHeaders1.RowHeaderItems.ValueFromIndex[fRowIndex];
for fColIndex:=0 to LxmHeaders1.ColumnHeaderItems.Count-1 do
begin
fCol := ExcelCol2Fps(LxmHeaders1.ColumnHeaderItems.Names[fColIndex]);
fType := LxmHeaders1.ColumnHeaderItems.ValueFromIndex[fColIndex];
tm1function := GenDataTm1Function(fTm1, fCompany, fMonth, fItem, fType);
sWorksheetGrid2.Worksheet.WriteFormula(fRow, fCol, tm1function);
fcell := sWorksheetGrid2.worksheet.FindCell(fRow, fCol);
sWorksheetGrid2.worksheet.WriteCellProtection(fcell, []);
end;
end;
end;