|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Problem with calendar controlI am unable to set the width for the day cells in the calendar control. I am
controls to various days for events and have set wrap to false. The problem I am having is I am getting some really skinny days because they are getting squeezed. I have tried to set the width in the DayRender handler but an hot having any luck. Anyone got any suggestions? ----- Ron Harter | Tongue, Tied and Twisted rdhar***@comcast.net | Just An Earthbound Misfit ... I Show quoteHide quote | Pink Floyd On 3 July, 04:21, "Ron Harter" <rdhar***@comcast.net> wrote: Hi Ron> I am unable to set the width for the day cells in the calendar control. I am > controls to various days for events and have set wrap to false. The problem > I am having is I am getting some really skinny days because they are getting > squeezed. I have tried to set the width in the DayRender handler but an hot > having any luck. Anyone got any suggestions? > > ----- > Ron Harter | Tongue, Tied and Twisted > rdhar***@comcast.net | Just An Earthbound Misfit ... I > | Pink Floyd I think the problem lay in the fact that day column widths are normally set using percentages. So, for example, if you set the column of one of them to a pixel value the browser readjusts the table width to preserve the ratios of the other columns which results in all columns still being the same width. To exercise proper control it is necessary to set the width of each column explicitly. For example to make Monday twice as wide as the other days the DayRender event code could be: if(e.day.DayOfWeek == DayOfWeek.Monday) e.day.cell.width = Unit.Percentage(25.0); else e.Cell.DayOfWeek.Width = Unit.Percentage(12.5); HTH > if(e.day.DayOfWeek == DayOfWeek.Monday) e.day.cell.width = Oops that should have been:> Unit.Percentage(25.0); > else e.Cell.DayOfWeek.Width = Unit.Percentage(12.5); if(e.day.DayOfWeek == DayOfWeek.Monday) e.cell.width = Unit.Percentage(25.0); else e.cell.Width = Unit.Percentage(12.5); sorry |
|||||||||||||||||||||||