search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

4.2 and 4.3 Trial 99 Columns

Asked by Scott Lee
14 years ago.
I am getting an Invalid Argument error in the AXD file of an ASP.Net project when the number of columns in the DayPilotCalendar exceeds 99. Is this by design?
Comment posted by Dan Letecky
14 years ago.
There used to be a limit of 25 columns but that was removed some time ago. Can you please post the stack trace?
Comment posted by Scott Lee
14 years ago.

Here is the stack:

> JScript anonymous function JScript
JScript anonymous function JScript
_ctl0_MainPageContent_schedule_Init JScript
JScript global code JScript

It is throwing the exception in the WebResource.axd file at:

$a.width=$C.Width+"%";

The uniqueID for $a is "ms__id1".

$C looks like this:

Width: 0
ToolTip: null
Name: "12/4/2007<br/>1-a"
InnerHTML: "12/4/2007<br/>1-a"
Date: "December 4, 2007 00:00:00 +0000"
Value: "1"
BackColor: "#ECE9D8"

I hope this helps.

Thank you,
Scott

Comment posted by Dan Letecky
14 years ago.
Oh, yes. The column width is calculated as (int) 100/columnCount (percent). This sets the width to 0% for columnCount > 99.

I think this can be fixed, both IE and FF accept decimal numbers there as well.
Comment posted by Scott Lee
14 years ago.
I am not sure I understand your reply. (int)100/99 would be 1 as would (int)100/100. 101 cols and greater would resolve to be 0 and the problem starts at 99. Sorry for my ignorance.
Comment posted by Dan Letecky
14 years ago.
Yes, you are correct. My calculation wasn't accurate.

But according to my tests, it causes problems for Columns.Count > 100, exactly like you say. I was trying a simple loop in Page_Load:
for (int i = 0; i < 100; i++)
{
DayPilotCalendar1.Columns.Add(i.ToString(), i.ToString());
}
But isn't it possible that you already have some Columns defined in the .aspx template (I would guess for 2 columns) and add more columns in the code behind without calling DayPilotCalendar1.Columns.Clear() first?

I also realized that although IE can work with div.style.width in decimal percent (10.2%) it generates an error for td.style.width with the same value. I will try using minimum of 1% width for all columns (IE should shrink the width automatically).
Comment posted by Dan Letecky
14 years ago.
I was trying to use 1% as the minimum width but this breaks the alignment of the header columns with the background columns.

But let's get back to your scenario - what's the use case for showing 100 columns? Unless you extend the control width to let's say 6000 pixels the columns will be so narrow that the events inside won't be readable. The rendering routine is designed to show much lower number of columns (that's why it takes so long in IE to load it).

Wouldn't it be better to use DayPilotScheduler instead? It should have much better performance (and even better after 4.4 release with the on-demand loading) and it supports unlimited number of resources.
Comment posted by Scott Lee
14 years ago.

We aretrying to use the calendar as an interactive ui for scheduling service routes. The columns must describe a route for a day with the rows being time slots. (We have an existing app (winform) that uses DBI's calendar control in that format). While there is a practical limit to how many columns a user could deal with, it is well within reason that the person doing this task will wish to see all routes (could be 100) over a 6 day period. The bottom line is, the pivioted view provided by the Scheduler control will not do.

What would be best is to allow (column width in pixels) * (number of columns)to determine the table width.

Comment posted by Dan Letecky
14 years ago.
OK. That would be a solution - it could calculate the column width in pixels if the total width was specified in pixels.

It seems that for so many columns, a built-in horizontal scrollbar and a possibility to load the content on-demand (while scrolling) would be handy. I've planned these two features for the next version of DayPilotScheduler and never expected it to be necessary for DayPilotCalendar.
It seems that the next step for DayPilotCalendar will be adding another row into the column header (for grouping the columns), horizontal scrollbar and on-demand loading.

I would like to include the fixed width solution in the next release, it's not a big change. Let me know if you want to test it in a private build before that release (daypilot @ annpoint.com).
This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.