How do I know which alternating row specification is being used?

  • imgodot 2 months, 1 week ago

    I have a grid that is using alternating rows.
    I want to change the foreground color to match the background color to hide the data in the cell on a cell-by-cell basis.

    How do I get the background color of row X in a Spread with alternating row colors.
    I guess I could use the modulus of the row# to figure out which alternating row specification to look at.

    Is there a more direct method?

    – Paul

  • 50p
    Deepak Sharma50p 2 months, 1 week ago

    Hi Paul,

    You can create an object for AlternateRow and set it’s ForeColor to as same as the AlternateRows backcolor.
    Please have a look at the attached sample application.

    Deepak Sharma

    You must be logged in to view attched files.
  • imgodot 2 months, 1 week ago


    Thanks for the response.
    I can now get the colors assigned correctly.

    However, now I have a problem with the highlight color.
    I am trying to make certain, specific cells invisible by making their forecolor = backcolor.
    Unfortunately, when the row is highlighted (OperationMode = SingleSelect), the text color is changed, becoming visible.

    I can’t see how to change how the row highlight affects certain cells differently.
    Do you have any ideas on that issue?

    – Paul

  • seanlawyer 2 months, 1 week ago


    You can use GetCompositeInfo to get the composed style settings actually displayed in the cell:

    FarPoint.Win.Spread.StyleInfo info = new FarPoint.Win.Spread.StyleInfo();
    sheet.Models.Style.GetCompositeInfo(row, column, row % sheet.Models.Style.AltRowCount, info);

    Details about the style model are here.


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to create new topics.