@srinudhulipalla
You may use the code sample given below:
internal sealed class MyTextStyleCallback : ITextStyleModificationCallback
{
public void BeforeTaskTextStyleApplied(TaskTextStyleEventArgs args)
{
if (args.Task.Get(Tsk.Uid) % 2 == 0)
{
args.CellTextStyle.BackgroundColor = Color.Cyan;
args.CellTextStyle.BackgroundPattern = BackgroundPattern.SolidFill;
}
}
}
public void Test1()
{
var project = new Project("c:\\test\\New Project 2016.mpp");
var view = ProjectView.GetDefaultTaskSheetView();
view.Columns[0].TextStyleModificationCallback = new MyTextStyleCallback();
project.Save("c:\\Project_Exported.pdf",
new PdfSaveOptions
{
PageSize = PageSize.A3,
View = view,
PresentationFormat = PresentationFormat.GanttChart
});
}
Moreover, we will make it a part of our documentation. Please share your feedback and feel free to write back to us if any further information is required.