BackColor for spreadsheet cells/columns/rows?

4 posts, 1 answers
  1. Ian
    Ian avatar
    20 posts
    Member since:
    Dec 2015

    Posted 07 Nov 2018 Link to this post

    I can't seem to get the back color of a cell, row or column to set programatically.

    The ribbon lets me choose a back (fill) color, but nothing happens. 

    I can find the 'setForeColor' method, but there isn't a 'setBackColor'. Can you confirm that this is right ?

    I CAN set back colors using the Styles = good/bad/neutral from the UI.

    So is the only way to set the back color to create my own CellStyle, and use that?

    Is there any documentation on how to do this? Using the Visual Studio debugger makes it a very slow process of software archeology!

  2. Answer
    Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3215 posts

    Posted 07 Nov 2018 Link to this post

    Hello, Ian, 

    In order to customize the loaded worksheet, it is necessary to apply the desired style to the specific CellSelection according to the API that the RadSpreadProcessing library offers: https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/working-with-cells/get-set-clear-properties

    Here is a basic code snippet how to change the fore color for the cells in the specified selected range: 

    Workbook workbook = this.radSpreadsheet1.Workbook;
    Worksheet worksheet = workbook.Worksheets.First();
    CellSelection selection = worksheet.Cells[0, 0, 5, 5];
    selection.SetForeColor(ThemableColor.FromArgb(115, 125, 125, 125));

    I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Ian
    Ian avatar
    20 posts
    Member since:
    Dec 2015

    Posted 08 Nov 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Looks like there is LOTS of good stuff here  - thanks.

    (would be great to have more references to, and examples of, this kind of function. I suspect most people will be using this control (instead of a real spreadsheet) because they want to manipulate it in code, so the more examples, the easier to do that. I'm finding it a bit hard to do this manipulation without any examples)

  4. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3215 posts

    Posted 09 Nov 2018 Link to this post

    Hello, Ian, 

    RadSpreadsheet utilizes the RadSpreadProcessing library. It is a part of the Document Processing and the relevant documentation is available on a separate site. If you need to manipulate a document programatically it is suitable to use the RadSpreadProcessing library. If you face any further difficulties with it, you can submit a support ticket with the Document Processing product and thus our support staff will gladly assist you.

    Should you have further questions please let me know.

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top