Dear Syncfusion Team,
I would like to change the font size and color in some lines of the SfTreeGrid, based on the content. I found your example, so I created an onRowDataBound event handler:
void onRowDataBound(RowDataBoundEventArgs<IncomeStatementData> args)
{
IncomeStatementData myArgs = args.Data;
if ((myArgs.OldAccountNo != null) && (myArgs.OldAccountNo.StartsWith("X")))
{
args.Row.AddClass(new string[] { "MainLine" });
}
else if (myArgs.OldAccountNo == null)
{
args.Row.AddClass(new string[] { "Level1Line" });
}
else if ((myArgs.OldAccountNo != null) && (myArgs.OldAccountNo.Length ==2))
{
args.Row.AddClass(new string[] { "Level2Line" });
}
}
and I added a style:
<style>
.MainLine
{
font-weight: bold;
font-size: 32px;
}
.Level1Line
{
font-weight: bold;
font-size: 12px;
color: #66b3ff;
}
.Level2Line
{
font-weight: bold;
font-size: 12px;
}
</style>
However it seems the font color and the size is not changeable: all the lines are black and all of them are with the same font size.
How can I change the font color and the size, please?
Dear Pon, thank you to point me to the appropriate documentation part.
Nota Bene: I had to include the !important tag too to apply the color change, but now all is OK.