I am constructing Dynamically a calendar with a table in RIchviewedit.
The background an text color of every day is defined in a database and apply them:
for d:=1 to topday do
begin
table1.Cells[x,d].Clear;
rvs.TextStyles[1].Color:=Query.fieldbyName('CALENDAR_TEXT').asinteger;
table1.Cells[x,d].AddNL(inttostr(d),0,1);
table1.Cells[x,d].Color:=Query.fieldbyName('CALENDAR_BACKG').asinteger;
end;
background color it's fine. But the text color is always black.
You change the Color property of the text style with the index = 1.
But in AddNL method, you use the text style with the index = 0.
The parameters of AddNL:
1) text to display
2) index of text style
3) index of paragraph style (or -1 to continue paragraph)
And you do not construct styles dynamically in this code, you change properties of existing style (assuming that you have 2 styles in rvs.TextStyles). So, all text of this style will have color assigned to this style in the last time. You can move the line assigning text style color before the cycle.