Hey.
I am using RadSheduler and it's AppointmentTemplate.
In my ObjectDataSource for RadSheduler i have Tour objects, each of them include list of Drivers oneself (one tour may have many drivers).
like this:
Class Tour{ Class Driver{ int ID, int ID, Datetime StartDate, string Name, Datetime Enddate, Datetime Start, List<Driver> Drivers Datetime End } }So, my sheduler datasource is list of tours.
Now i want to achieve these:
1.) show the list of drivers in my AppointmentTemplate for each tour (main goal) - what is the best way to do this?
2.) each driver has start and end dates (start represents the date when the driver started or joined the tour), they are alway between the tour's StartDate and EndDate. So, i'd like the driver name to appear under the date when he joined the tour. For instance - if tour StartDate is May 2, and driver1 started the tour, and driver2 joined on May 4 AppointmentTemp to look like something as in attached file. Is that possible anyway?
thanks.

| <script type="text/javascript"> |
| function confirmFn(text, itemIndex) { |
| var callBackFn = function(arg) { |
| if (arg) { |
| var masterTable = $find("<%= rgMembers.ClientID %>").get_masterTableView(); |
| masterTable.fireCommand("DeleteMember", itemIndex); |
| } |
| } |
| radconfirm(text, callBackFn); |
| } |
| </script> |
| <telerik:RadAjaxManager ID="ramManageMembers" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="ramManageMembers"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="rgMembers" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="rgMembers"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="rgMembers" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| <telerik:RadGrid ID="rgMembers" runat="server" Width="100%" ShowStatusBar="False" Skin="mySkin" EnableEmbeddedSkins="false" |
| AutoGenerateColumns="False" PageSize="10" AllowSorting="True" AllowMultiRowSelection="False" |
| AllowPaging="True" OnItemDataBound="rgMembers_ItemDataBound"> |
| <PagerStyle NextPageText="" PrevPageText="" AlwaysVisible="True" Mode="NextPrevAndNumeric" Position="TopAndBottom" Font-Bold="False" Font-Italic="False" |
| HorizontalAlign="Right" PageButtonCount="8" PagerTextFormat="Page: {4} Displaying page {0} of {1}, items {2} to {3} of {5}." |
| Wrap="True" FirstPageImageUrl="" FirstPageText="" LastPageText="" VerticalAlign="Middle" /> |
| <MasterTableView Width="100%" DataKeyNames="ApplicantID" AllowMultiColumnSorting="False"> |
| <Columns> |
| <telerik:GridBoundColumn UniqueName="gcApplicantID" SortExpression="ApplicantID" HeaderText="ApplicantID" HeaderButtonType="TextButton" |
| DataField="ApplicantID" Visible="False" ItemStyle-HorizontalAlign="Right"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn UniqueName="gcPassNumber" SortExpression="PassNumber" HeaderText="Pass #" HeaderButtonType="TextButton" |
| DataField="PassNumber" Visible="True" DataformatString="{0:D5}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn UniqueName="gcTitle" SortExpression="Title" HeaderText="Title" HeaderButtonType="TextButton" |
| DataField="Title" Visible="false"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn UniqueName="gcLastName" SortExpression="LastName" HeaderText="Last Name" HeaderButtonType="TextButton" |
| DataField="LastName"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn UniqueName="gcFirstName" SortExpression="FirstName" HeaderText="First Name" HeaderButtonType="TextButton" |
| DataField="FirstName" ItemStyle-Width="120px"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn UniqueName="gcMiddleName" SortExpression="MiddleName" HeaderText="Middle Name" HeaderButtonType="TextButton" |
| DataField="MiddleName" Visible="false"> |
| </telerik:GridBoundColumn> |
| <telerik:GridTemplateColumn UniqueName="gtcEdit"> |
| <HeaderTemplate> |
| Edit |
| </HeaderTemplate> |
| <ItemTemplate> |
| <div class="functionButtons"> |
| <asp:Button runat="server" Text="" CssClass="btnEdit" ID="btnEdit" CommandName="EditClicked" /> |
| </div> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridButtonColumn UniqueName="gbcDelete" Text="" HeaderText="Delete" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" |
| ButtonType="PushButton" ButtonCssClass="btnDelete" Visible="false"> |
| </telerik:GridButtonColumn> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid> |
| <telerik:RadWindowManager ID="rwmConfirmDelete" runat="server" KeepInScreenBounds="true" Title="Delete Member?" InitialBehaviors="Close,Move" Behaviors="Close,Move" |
| Skin="Simple" Width="450px"> |
| </telerik:RadWindowManager> |
| Protected Sub rgMembers_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgMembers.ItemCommand |
| Dim Applicant As New DAL.Applicant |
| Dim curUserID = AppSession.CurrentUser.UserID |
| Select Case e.CommandName |
| Case "EditClicked" |
| ApplicantID = CType(rgMembers.MasterTableView.DataKeyValues.Item(e.Item.ItemIndex)("ApplicantID"), Integer) |
| AppSession.CurrentApplicant = New DAL.Applicant(ApplicantID) |
| pnlsearch.Visible = False |
| appDetails.PopulateForm() |
| Case "ExportToExcel" |
| ConfigureExport() |
| 'exporting data |
| Case "DeleteMember" |
| 'show confirm box. |
| ApplicantID = CType(rgMembers.MasterTableView.DataKeyValues.Item(e.Item.ItemIndex)("ApplicantID"), Integer) |
| AppSession.CurrentApplicant = New DAL.Applicant(ApplicantID) |
| With AppSession.CurrentApplicant |
| .Deleted = True |
| .LastUpdated = Now |
| .LastUpdatedID = curUserID |
| .Update() |
| End With |
| rgMembers.Rebind() |
| MasterPage.PageStatusText = AppSession.CurrentApplicant.LastName + ", " + AppSession.CurrentApplicant.FirstName + " (Pass #: " + String.Format("{0:D5}", AppSession.CurrentApplicant.PassNumber.ToString) + ") has been successfully deleted." |
| AppSession.CurrentApplicant = Nothing |
| Case Else |
| Exit Sub |
| End Select |
| End Sub |
| If TypeOf e.Item Is GridDataItem Then |
| Dim item As GridDataItem = TryCast(e.Item, GridDataItem) |
| Dim cell As TableCell = item("gbcDelete") |
| Dim btnDelete As Button = DirectCast(cell.Controls(0), Button) |
| btnDelete.Attributes.Add("onclick", "confirmFn('Are you sure you want to delete member " + item("gcLastName").Text + ", " + item("gcFirstName").Text + " ?" + "','" + CStr(e.Item.ItemIndex) + "'); return false;") |
| End If |
| End Sub |
<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true" CodeBehind="BulkLoad.aspx.cs" Inherits="MyProject.WebApp.BulkLoad" %><%@ Register TagPrefix="rad" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %><%@ Register Src="~/Controls/BulkUploadControl.ascx" TagName="BulkUpload" TagPrefix="cag" %><%@ Register Src="~/Controls/BulkUploadAuditControl.ascx" TagName="BulkUploadAudit" TagPrefix="cag" %><asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="BottomPane" runat="server"> <br /> <div class="level2_tabstrip"> <rad:RadTabStrip RegisterWithScriptManager="true" AutoPostBack="True" SelectedIndex="1" MultiPageID="RadMultiPage1" ID="rtsBulkLoad" runat="server" Skin="WebBlue"> <Tabs> <rad:RadTab Text="Upload" PageViewID="Upload" Selected="True"> </rad:RadTab> <rad:RadTab Text="Audit" PageViewID="Audit"> </rad:RadTab> </Tabs> </rad:RadTabStrip> </div> <div class="level2_content"> <rad:RadMultiPage RenderSelectedPageOnly="true" ID="RadMultiPage1" runat="server" SelectedIndex="1" Width="900"> <rad:RadPageView ID="Upload" runat="server" Selected="true"> <cag:BulkUpload runat="server" ID="BulkUpload1" BatchTypeDesc="" /> </rad:RadPageView> <rad:RadPageView ID="Audit" runat="server"> <cag:BulkUploadAudit runat="server" ID="BulkUploadAudit1" BatchTypeDesc="" /> </rad:RadPageView> </rad:RadMultiPage> </div></asp:Content><%@ Control Language="C#" AutoEventWireup="true" CodeBehind="BulkUploadControl.ascx.cs" Inherits="Myproject.WebApp.Controls.BulkUploadControl" %><%@ Register TagPrefix="rad" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %><script language='javascript' type='text/javascript'> function showLoading() { document.getElementById('blackOut').style.display = 'block'; document.getElementById('blackOut').style.height = '500px'; document.getElementById('blackOut').style.width = '942px'; }</script><rad:RadWindowManager ID="RadWindowManager1" runat="server" /><asp:Panel runat="server" ID="pnlAccessDenied" Visible="true"> You do not have permission for this function</asp:Panel><asp:Panel runat="server" ID="pnlAccessOk" Visible="false"> <br /> <asp:Label ID="lblTitle" Font-Bold="True" Font-Size="X-Large" runat="server" Font-Names="Arial"></asp:Label> <br /> <br /> <asp:Label ID="lblText" Font-Bold="False" Font-Size="Small" runat="server" Font-Names="Arial"></asp:Label> <br /> <br /> <div id="blackOut" style="display: none; z-index: 1000000; position: absolute; background-color: black; filter: alpha(opacity=70); -moz-opacity: 0.7; opacity: 0.7; top: -300px; left: -10px; height: 1000px; width: 1500px;"> <table width="1000px" style="height:1000px;"> <tr> <td align="center" valign="middle" > <h2 style="color: White; font-weight: bold"> Processing...</h2> </td> </tr> </table> </div> <table width="850" border="0" cellspacing="0" cellpadding="10" class="table_grid"> <tr> <td> <b>Upload</b> </td> <td> <asp:Label runat="server" ID="lblReportingPeriodStatus" ForeColor="Red" Visible="false"></asp:Label> </td> </tr> <tr> <td colspan="100%"> <input class="textbox" size="100" type="file" id="File1" runat="server" name="File1" /> <asp:Button ID="buttonSubmit" class="button" runat="server" OnClick="btnSubmit_OnClick" OnClientClick="showLoading();" Text="Upload" Height="23px" /> <br /> <br /> <table width="850" class="table_grid3"> <tr> <td width="200"> Local Path </td> <td class="td_clear"> <asp:Label runat="server" ID="lblLocalPath"></asp:Label> </td> </tr> <tr> <td> Batch ID </td> <td class="td_clear"> <asp:Label runat="server" ID="lblBatchID"></asp:Label> </td> </tr> <tr> <td> Loaded to Staging </td> <td class="td_clear"> <asp:Image ID="Image2a" runat="server" ImageUrl="~/Images/gtick01.gif" Visible="false" /> <asp:Image ID="Image2b" runat="server" ImageUrl="~/Images/gcross01.gif" Visible="false" /> </td> </tr> <tr> <td> Status Message </td> <td class="td_clear"> <asp:Label runat="server" ID="lblStatusMessage"></asp:Label> </td> </tr> </table> <asp:Label runat="server" ID="lblSaveResults"></asp:Label><br /> <asp:Label runat="server" ID="lblLoadResults"></asp:Label><br /> </td> </tr> </table> <br /> <rad:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" OnItemDataBound="RadGrid1_ItemDataBound" EnableAJAX="True" Width="850px" AllowPaging="True" PageSize="50" Skin="WebBlue" Visible="false"> <PagerStyle AlwaysVisible="true" Mode="NumericPages" /> <SelectedItemStyle CssClass="selectedItem" /> <EditItemStyle CssClass="selectedItem" /> <ExportSettings IgnorePaging="true" /> <MasterTableView CommandItemDisplay="Top" GridLines="Horizontal" EditMode="EditForms" TableLayout="Auto" AutoGenerateColumns="False"> <CommandItemSettings ShowExportToCsvButton="true" /> <Columns> <rad:GridBoundColumn Visible="false" UniqueName="field1" HeaderText="field1" DataField="field1" /> <rad:GridBoundColumn HeaderStyle-Width="50px" UniqueName="Row" HeaderText="Row" DataField="Row" /> <rad:GridBoundColumn HeaderStyle-Width="50px" UniqueName="Column" HeaderText="Column" DataField="Column" /> <rad:GridBoundColumn HeaderStyle-Width="100px" UniqueName="ColumnName" HeaderText="Column Name" DataField="columnName" /> <rad:GridBoundColumn HeaderStyle-Width="100px" UniqueName="ColumnType" HeaderText="Column Type Expected" DataField="columnType" /> <rad:GridBoundColumn HeaderStyle-Width="100px" UniqueName="ColumnValue" HeaderText="Column Value" DataField="columnValue" /> <rad:GridBoundColumn UniqueName="ErrorText" HeaderText="Error" DataField="ErrorText" /> </Columns> </MasterTableView> </rad:RadGrid></asp:Panel>