var style = new GrapeCity.Windows.SpreadSheet.Data.StyleInfo();
style.Background = new SolidColorBrush(Colors.Blue);
style.BorderLeft = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(Colors.Red);
style.BorderTop = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(Colors.Red);
style.BorderRight = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(Colors.Red);
style.BorderBottom = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(Colors.Red);
var style1 = new GrapeCity.Windows.SpreadSheet.Data.StyleInfo();
style1.Background = new SolidColorBrush(Colors.Green);
var style2 = new GrapeCity.Windows.SpreadSheet.Data.StyleInfo();
style2.Background = new SolidColorBrush(Colors.Yellow);
var rule = GrapeCity.Windows.SpreadSheet.Data.DateOccurringRule.Create(GrapeCity.Windows.SpreadSheet.Data.DateOccurringType.NextWeek, style);
rule.Ranges = new GrapeCity.Windows.SpreadSheet.Data.CellRange[] { new GrapeCity.Windows.SpreadSheet.Data.CellRange(0, 0, 10, 1) };
gcSpreadSheet1.Sheets[0].ConditionalFormats.AddRule(rule);
gcSpreadSheet1.Sheets[0].SetValue(0, 0, GrapeCity.Windows.SpreadSheet.Data.SheetArea.Cells, DateTime.Now);
gcSpreadSheet1.Sheets[0].SetValue(1, 0, GrapeCity.Windows.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(1));
gcSpreadSheet1.Sheets[0].SetValue(2, 0, GrapeCity.Windows.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(5));
gcSpreadSheet1.Sheets[0].SetValue(3, 0, GrapeCity.Windows.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(6));
gcSpreadSheet1.Sheets[0].SetValue(4, 0, GrapeCity.Windows.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(7));
gcSpreadSheet1.Sheets[0].SetValue(5, 0, GrapeCity.Windows.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(8));
gcSpreadSheet1.Invalidate();