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

Grouping Rows

Asked by Mike Fleming
9 years ago.

Hi, I want to group entries on the EnvName feild (LJ10 in the example)

My setting are:

<DayPilot:DayPilotScheduler ID="DayPilotScheduler2" runat="server"
DataStartField="Start"
DataEndField="End"
DataTextField="ProjectName"
DataValueField="id"
DataResourceField="id"
CellGroupBy="Month"
CellDuration="1440"
StartDate="2011-01-01"
Days="365"
Width="100%"
EventHeight="20"
HeaderFontSize="8pt"
EventFontSize="8pt"
EventMoveHandling="CallBack" DataSourceID="Booking1"
style="top: 0px; left: 0px; height: 64px" BackColor="#FFFFD5"
BorderColor="Black" CellSelectColor="#316AC5"
DurationBarColor="Blue" EventBackColor="White" EventBorderColor="Black"
HeaderFontColor="Black" HeaderHeight="17" HourBorderColor="#EAD098"
HourNameBackColor="#ECE9D8" HourNameBorderColor="#ACA899"
NonBusinessBackColor="#FFF4BC" ScrollX="0" ScrollY="0"
DataTagFields="UserName" > </DayPilot:DayPilotScheduler>

and the code I am using to add resources is:

Dim objCommand As New SqlCommand("select * from dbo.ProjectToEnvironmentBooking", conn)
conn.Open()
Dim da1 As New SqlDataAdapter(objCommand)
Dim dt1 As New DataTable()
da1.Fill(dt1)
For Each r As DataRow In dt1.Rows
Dim name As String = DirectCast(r("EnvName"), String)
Dim id As String = CType(r("id".ToString), String)
DayPilotScheduler2.Resources.Add(name, id)
If r("start") < earlieststart Then
earlieststart = r("Start")
End If

If r("End") > latestend Then
latestend = r("End")
End If
DayPilotScheduler2.StartDate = earlieststart.AddDays(-7)
Next

How do I achieve this?

Many thanks in advance,

Mike

Answer posted by Dan Letecky [DayPilot]
9 years ago.

You should only add one row for this resource to the Resources collection:

DayPilotScheduler2.Resources.Add("LJ10", "LJ10") 

You should be able to list the resources using an SQL query similar to this one:

select distinct EnvName from dbo.ProjectToEnvironmentBooking
This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.