Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
310
Toggle-freeze on a cell in XamSpreadSheet from code behind.
posted

How can I toggle-freeze on a cell in XamSpreadSheet. Say I want to freeze on cell D7 on the sheet. How can I do it programmatically from code behind.

  • 6365
    Offline posted

    Hello Sherry,

    In order to freeze the XamSpreadsheet based on a specific cell (all rows above it and all columns left of it), you can use a SpreadsheetCommand with a SpreadsheetCommandType set to ToggleFreezePanes. This command will freeze the control based on the currently active cell by default (we can set the active cell in code-behind).

    For example:

    spreadsheet.ActiveCell = new SpreadsheetCell("D7");

    SpreadsheetCommand cmd = new SpreadsheetCommand(SpreadsheetCommandType.ToggleFreezePanes);
    cmd.Execute(spreadsheet);

    For more detailed information on working with the commands for the XamSpreadsheet, you can take a look at the following topic.

    I have attached a sample application that demonstrates the approach from above.

    If you have any questions, please let me know.

    XamSpreadsheet_sample.zip