Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Color of Text in SRP EditTable

I have been working with the amazing and wonderful SRP EditTable, when I came across some weird behavior. I am changing the color of certain rows based on various information, and when the first row has its color changed (e.g. the first row has red text now and the other rows are black text) then all the other cells change to red as well.

I am changing the cell to red with this line of code (with the variables set appropriately): Set_Property(Ctrl, "OLE.CellColors[all;":i:"]", 'Red') The other cells only also become red if it is the FIRST row that I set to red. If I set other rows to red, then the other cells keep their black text. I have traced through the program with the debugger and the unwanted color change happens after the last line of my program.

Do you guys know of any issue like this? Have you seen this kind of behavior before in an SRP EditTable?

I haven’t looked at our promoted events, but I don’t know why they would cause this change, and I thought I’d ask.

As always, thanks so much for you time and help.

Adam Chan

User: Adam Chan

Comments

  • Hi Adam, just sprouting the first thoughts that came into my head without testing/checking anything but it might help.

    Are you changing the colour of the cell before or after it is populated or before or after the remaining cells are populated.

    I vaguely recall having something similar some time ago and I think the cause was in the sequencing. I think I was probably inserting rows rather than using array or list and like yourself wanted to colour based on the content. Worked fine unless I changed the colour of the first row because all subsequent rows inherited the characteristics of the previous or at least the first row.

    The memory is a bit rusty on this but I either made some amendment to the sequence of the calls, like populating everything first and then looping through to do the colour change or by ensuring I just set the colour of every cell/row with each insert so as to ensure the black rows remained black.

    Or I might be completely off the mark...
  • Adam,

    I believe Mark is correct. I've done similar to what you've both have done, and just colored the cells (or rows) appropriately, after all the data is done and set in place.
  • Adam,

    Are you using the RowsToRecords property? If so, what value are you setting?
  • Frank and Mark are correct. Whenever new rows are added, the SRP EditTable conveniently copies the style of the row before it. So, you want to make sure you colorize rows after they have been already added.
  • Thank you everyone for the quick and helpful replies. I believe there is a function that is clearing and repopulating the edittable after I set the color of the first row, so it makes sense that the rest of the rows are now taking on the color properties of the first cell. I'm out of the office today, but I will look into that ASAP. It makes perfect sense that this could be happening.

    Thank you, all very much! I'll try to post a follow up next week!

    User: Adam Chan
Sign In or Register to comment.