I removed EventSortExpression because the query I run orders the way I want them to into the datatable. I would figure that the rows would populate just the way they become in the datatable. Here are the fields I poll:
ID - Int
Name - nvarchar
Date - Date
Order - char (A or B)
Time - nvarchar (AM or PM)
Running my query, here is a day that comes up in my query:
1 Brant Cooper 2013-05-01 A AM
2 Brooke Kyle 2013-05-01 B AM
3 Cristin Babcock 2013-05-01 A PM
4 Frederick Green 2013-05-01 B PM
Now in a secondary function, I go through and insert "Primary" and "Secondary" datarows which works well with explorer and firefox. The function I do that with is:
static private DataTable addOrder(DataTable dt, DateTime start)
{
int counter = 0;
int addDay = 0;
start = Convert.ToDateTime("5 / 1 / 2013");
//create table for format
DataTable formatted = new DataTable();
formatted.Columns.Add("Start", typeof(DateTime));
formatted.Columns.Add("End", typeof(DateTime));
formatted.Columns.Add("Subject", typeof(string));
formatted.Columns.Add("Id", typeof(string));
//create rows for primary and secondary
DataRow primary = formatted.NewRow();
primary["Subject"] = "Primary";
primary["Id"] = "ABC123";
DataRow secondary = formatted.NewRow();
secondary["Subject"] = "Secondary";
secondary["Id"] = "321CBA";
foreach (DataRow row in dt.Rows)
{
if (counter == 0)
{
primary["Start"] = start.AddDays(addDay).ToShortDateString();
primary["End"] = start.AddDays(addDay).ToShortDateString();
formatted.Rows.Add(primary.ItemArray);
formatted.ImportRow(row);
counter++;
}
else if (counter == 1)
{
formatted.ImportRow(row);
counter++;
}
else if (counter == 2)
{
secondary["Start"] = start.AddDays(addDay).ToShortDateString();
secondary["End"] = start.AddDays(addDay).ToShortDateString();
formatted.Rows.Add(secondary.ItemArray);
formatted.ImportRow(row);
counter++;
}
else if (counter == 3)
{
formatted.ImportRow(row);
counter = 0;
addDay++;
}
}
return formatted;
}
Then when they get placed I do some custom event graphics (colors/images). Is my thinking about how this is displayed wrong? As I said above, I figured it would be displayed the way it shows in the datatable.