Style attributes don''t work when MonthShowFullWeek is set to true

Hi,

I have been facing a problem with the schedule control. Whenever I set the MonthShowFullWeek property of the schedule control to true, I am not able to set the style properties of any cell. The reason I am trying this is that I want to highlight the current date in the month and week views by giving the cell a border.
I am using the following code on the OnCellDrawn event:
e.Style.Borders.All = new GridBorder(GridBorderStyle.Solid, Color.Red);

This works if the MonthShowFullWeek is not set to true.
Please let me know if there is a solution or a workaround to this.

Thanks and Regards,
Vijayant Rao.


1 Reply

AD Administrator Syncfusion Team August 21, 2008 05:29 PM UTC

The likely problem you are seeing ios that as you change ScheduleViewTypes (or page through the calendar), the schedulegrid object get deleted and then recreated. So, it is difficult to keep an event subscribed as the grid's keep getting deleted.

So, for now, the only way to make sure your code will always be hits is to derive the ScheduleControl and override CreateScheduleGrid. There, you can create an instance of a derived grid so you can use its override to manage you special border instead of an event. Here is a minimal sample showing how you might do it.

http://www.syncfusion.com/support/user/uploads/CS_fc51f9e8.zip


Loader.
Up arrow icon