For the moment I am using JQuery to pass through the containing div size.
// Resizes the scheduler cell width on browswer resize.
// Uses concurrency principal to wait a period of
// time and fire one update at the end of, or pause of,resizing.
$(document).ready(function() {
function resizeScheduler() {
var newSchedulerWidth = $("#SchedulerContainer").width() - 270;
dps1.refreshCallBack(null, null, newSchedulerWidth);
}
var timeout = false;
$(window).resize(function(){
if(timeout !== false)
clearTimeout(timeout);
timeout = setTimeout(resizeScheduler, 300); // 300 millis
});
});
In the code behind I'm using the scheduler refresh callback to update the cell width with something similar to
protected void DayPilotScheduler1_Refresh(object sender, RefreshEventArgs e)
{
string s = e.Data.ToString();
int width = Int32.Parse(s);
width /= 26; // Num cells
DayPilotScheduler1.CellWidth = width;
DayPilotScheduler1.DataBind();
DayPilotScheduler1.Update(CallBackUpdateType.Full);
}
It's not perfect, as width is truncated from double to int. Over a long period of cells, depending on the resultant width, you can end up losing a few pixels at the end. There are a few enhancements you could make to this, but it works 'ok' for the moment.