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

  • imgodot 1 week, 3 days 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?

    Thanks.
    – Paul

  • 42p
    DeepakSharma1442p 1 week, 2 days 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.

    Regards,
    Deepak Sharma

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

    Deepak,

    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?

    Thanks.
    – Paul

  • seanlawyer 1 week, 2 days ago

    Hi,

    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.

    Regards,
    -Sean

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

You must be logged in to create new topics.