Hi Guys,
I have the following scenario:
I have a radscheduler and a radgrid being refreshed whenever the date range is changed in the radscheduler. I am using the event Navigation completed in the radscheduler to update the data for the grid. I am using a rad window in the grid for edit/insert.
The RadAjaxManager configuration is as follows:
<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" ClientEvents-OnRequestStart="conditionaPostback">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="radScheduler">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="radScheduler" />
<telerik:AjaxUpdatedControl ControlID="gdvTasks" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
The problem is that this way the radwindow is no more poping up when I click edit or insert in the grid.
If I remove the <telerik:AjaxUpdatedControl ControlID="gdvTasks" /> line from the ajaxmanager then the radwindow pops up but the problem is that the grid is no more refreshed automatically so I need to click on the refresh button in the grid in order for the latest data to be displayed.
One more thing is that I am adding the radwindow from code behind when the user clicks the insert or edit link buttons in the grid.
Any Help is appreciated. Thank you in advance.
I have the following scenario:
I have a radscheduler and a radgrid being refreshed whenever the date range is changed in the radscheduler. I am using the event Navigation completed in the radscheduler to update the data for the grid. I am using a rad window in the grid for edit/insert.
The RadAjaxManager configuration is as follows:
<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" ClientEvents-OnRequestStart="conditionaPostback">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="radScheduler">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="radScheduler" />
<telerik:AjaxUpdatedControl ControlID="gdvTasks" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
The problem is that this way the radwindow is no more poping up when I click edit or insert in the grid.
If I remove the <telerik:AjaxUpdatedControl ControlID="gdvTasks" /> line from the ajaxmanager then the radwindow pops up but the problem is that the grid is no more refreshed automatically so I need to click on the refresh button in the grid in order for the latest data to be displayed.
One more thing is that I am adding the radwindow from code behind when the user clicks the insert or edit link buttons in the grid.
Any Help is appreciated. Thank you in advance.
5 Answers, 1 is accepted
0
Hello elais,
Can you try adding the below setting as well and see if it makes any difference:
Best wishes,
Iana
the Telerik team
Can you try adding the below setting as well and see if it makes any difference:
<
telerik:AjaxSetting
AjaxControlID
=
"gdvTasks"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"gdvTasks"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadWindowManager_ID_here"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
Best wishes,
Iana
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0

elais
Top achievements
Rank 1
answered on 04 Feb 2011, 03:51 PM
I tried it and nothing changed. I even created the RadWindow through source code and not code behind and still the problem occurs.
0
Hi elais,
Can you share the full page code so I can try replicating the issue locally?
Best wishes,
Iana
the Telerik team
Can you share the full page code so I can try replicating the issue locally?
Best wishes,
Iana
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0

elais
Top achievements
Rank 1
answered on 07 Feb 2011, 03:03 PM
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Calendar.aspx.vb" Inherits="Calendar"
UICulture="auto" Culture="auto" %>
<%@ Register Assembly="DBLib" Namespace="DBLib" TagPrefix="DB" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register TagPrefix="scheduler" TagName="AdvancedForm" Src="AdvancedForm.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
runat
=
"Server"
ID
=
"RadScriptManager1"
>
<
Scripts
>
<
asp:ScriptReference
Path
=
"~/AdvancedForm.js"
/>
</
Scripts
>
</
telerik:RadScriptManager
>
<
script
type
=
"text/javascript"
>
//
<![CDATA[
// Dictionary containing the advanced template client object
// for a given RadScheduler instance (the control ID is used as key).
var schedulerTemplates = {};
function schedulerFormCreated(scheduler, eventArgs) {
// Create a client-side object only for the advanced templates
var mode = eventArgs.get_mode();
if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert ||
mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit) {
// Initialize the client-side object for the advanced form
var formElement = eventArgs.get_formElement();
var templateKey = scheduler.get_id() + "_" + mode;
var advancedTemplate = schedulerTemplates[templateKey];
if (!advancedTemplate) {
// Initialize the template for this RadScheduler instance
// and cache it in the schedulerTemplates dictionary
var schedulerElement = scheduler.get_element();
var isModal = scheduler.get_advancedFormSettings().modal;
advancedTemplate = new window.SchedulerAdvancedTemplate(schedulerElement, formElement, isModal);
advancedTemplate.initialize();
schedulerTemplates[templateKey] = advancedTemplate;
// Remove the template object from the dictionary on dispose.
scheduler.add_disposing(function() {
schedulerTemplates[templateKey] = null;
});
}
// Are we using Web Service data binding?
if (!scheduler.get_webServiceSettings().get_isEmpty()) {
// Populate the form with the appointment data
var apt = eventArgs.get_appointment();
var isInsert = mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert;
advancedTemplate.populate(apt, isInsert);
}
}
}
function conditionaPostback(sender, args) {
if (args.get_eventTarget().match(/SubmitButton/)) {
args.set_enableAjax(false);
}
}
function ShowEditForm() {
window.radopen("form.aspx?xml=tasks/TaskDetail.xml&TaskID=0", "RadWindow1");
return false;
}
//]]>
</
script
>
<
div
>
<
telerik:RadAjaxManager
runat
=
"server"
ID
=
"RadAjaxManager1"
ClientEvents-OnRequestStart
=
"conditionaPostback"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"radScheduler"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"radScheduler"
/>
<%--<
telerik:AjaxUpdatedControl
ControlID
=
"gdvTasks"
/>--%>
<
telerik:AjaxUpdatedControl
ControlID
=
"rdpDueDate"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<%--<
telerik:AjaxSetting
AjaxControlID
=
"RadWindow1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadWindow1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>--%>
<%--<
telerik:AjaxSetting
AjaxControlID
=
"gdvTasks"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"gdvTasks"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"windowManager_window1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>--%>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<%--<
telerik:RadWindowManager
ID
=
"windowManager"
runat
=
"server"
Left
=
""
Modal
=
"True"
Top
=
""
ShowContentDuringLoad
=
"True"
>
<
Windows
>
<
telerik:RadWindow
id
=
"widnow1"
runat
=
"server"
modal
=
"True"
height
=
"550px"
width
=
"750px"
Skin
=
"Outlook"
/>
</
Windows
>
</
telerik:RadWindowManager
>--%>
<
telerik:RadPanelBar
runat
=
"server"
ExpandMode
=
"SingleExpandedItem"
Width
=
"100%"
AllowCollapseAllItems
=
"true"
ID
=
"rpBar1"
Skin
=
"Outlook"
>
<
Items
>
<
telerik:RadPanelItem
Text="<%$ Resources:Calendar, pnlAppointment %>" Expanded="True"
TabIndex="1">
<
Items
>
<
telerik:RadPanelItem
>
<
ItemTemplate
>
<
div
style
=
"padding: 10px"
>
<
table
width
=
"100%"
cellpadding
=
"2"
cellspacing
=
"2"
>
<
tr
>
<
td
style
=
"width: 75px"
>
<
asp:Label
ID
=
"lblSubject"
runat
=
"server"
Text="<%$ Resources:Calendar, lblSubject %>"></
asp:Label
>
</
td
>
<
td
style
=
"width: 725px"
>
<
telerik:RadTextBox
ID
=
"rtbSubject"
runat
=
"server"
Skin
=
"Outlook"
Width
=
"250px"
>
</
telerik:RadTextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"width: 75px"
>
<
asp:Label
ID
=
"lblClient"
runat
=
"server"
Text="<%$ Resources:Calendar, lblClient %>"></
asp:Label
>
</
td
>
<
td
style
=
"width: 725px"
>
<
telerik:RadComboBox
ID
=
"rcbClient"
runat
=
"server"
Skin
=
"Outlook"
Width
=
"253px"
Height
=
"150px"
OffsetX
=
"10"
OffsetY
=
"15"
>
</
telerik:RadComboBox
>
</
td
>
</
tr
>
<
tr
>
<
td
colspan
=
"2"
>
<
table
>
<
tr
>
<
td
align
=
"right"
style
=
"width: 325px"
>
<
asp:Button
ID
=
"BtnSearch"
Text="<%$ Resources:Calendar, BtnSearch %>" runat="server"
OnClick="BtnSearch_Click" />
</
td
>
<
td
style
=
"width: 475px"
>
</
td
>
</
tr
>
</
table
>
</
td
>
</
tr
>
</
table
>
</
div
>
</
ItemTemplate
>
</
telerik:RadPanelItem
>
</
Items
>
</
telerik:RadPanelItem
>
</
Items
>
</
telerik:RadPanelBar
>
<
br
/>
<
telerik:RadScheduler
ID
=
"radScheduler"
runat
=
"server"
DataKeyField
=
"ID"
DataStartField
=
"Start"
DataEndField
=
"End"
DataSubjectField
=
"Subject"
Skin
=
"Outlook"
SelectedView
=
"WeekView"
StartInsertingInAdvancedForm
=
"true"
DataDescriptionField
=
"Notes"
DataRecurrenceField
=
"RecurrenceRule"
DataRecurrenceParentKeyField
=
"RecurrenceParentID"
StartEditingInAdvancedForm
=
"true"
CustomAttributeNames
=
"Location,ApptType,Contact"
OnFormCreated
=
"radScheduler_FormCreated"
OnAppointmentInsert
=
"radScheduler_AppointmentInsert"
OnAppointmentCreated
=
"radScheduler_AppointmentCreated"
OnAppointmentDataBound
=
"radScheduler_AppointmentDataBound"
OnClientFormCreated
=
"schedulerFormCreated"
OnNavigationComplete
=
"radScheduler_NavigationComplete"
OnNavigationCommand
=
"radScheduler_NavigationCommand"
>
<
AdvancedForm
Modal
=
"true"
/>
<
AdvancedEditTemplate
>
<
scheduler:AdvancedForm
runat
=
"server"
ID
=
"AdvancedEditForm1"
Mode
=
"Edit"
Subject='<%# Bind("Subject") %>'
Start='<%# Bind("Start") %>' End='<%# Bind("End") %>' Description='<%# Bind("Description") %>'
RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' AppType='<%# Bind("ApptType") %>'
Location='<%# Bind("Location") %>' Contact='<%# Bind("Contact") %>' />
</
AdvancedEditTemplate
>
<
AdvancedInsertTemplate
>
<
scheduler:AdvancedForm
runat
=
"server"
ID
=
"AdvancedInsertForm1"
Mode
=
"Insert"
Subject='<%# Bind("Subject") %>'
Start='<%# Bind("Start") %>' End='<%# Bind("End") %>' Description='<%# Bind("Description") %>'
RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' AppType='<%# Bind("ApptType") %>'
Location='<%# Bind("Location") %>' Contact='<%# Bind("Contact") %>' />
</
AdvancedInsertTemplate
>
<
TimeSlotContextMenus
>
<
telerik:RadSchedulerContextMenu
runat
=
"server"
ID
=
"SchedulerTimeSlotContextMenu"
>
<
Items
>
<
telerik:RadMenuItem
Text="<%$ Resources:Calendar, RadMenuItemNew %>" Value="CommandAddAppointment" />
<
telerik:RadMenuItem
Text="<%$ Resources:Calendar, RadMenuItemGo %>" Value="CommandGoToToday" />
</
Items
>
</
telerik:RadSchedulerContextMenu
>
</
TimeSlotContextMenus
>
<
AppointmentContextMenus
>
<
telerik:RadSchedulerContextMenu
runat
=
"server"
ID
=
"ContextMenu1"
>
<
Items
>
<
telerik:RadMenuItem
Text="<%$ Resources:Calendar, lbEdit %>" Value="CommandEdit" />
<
telerik:RadMenuItem
Text="<%$ Resources:Calendar, lbDelete %>" Value="CommandDelete" />
</
Items
>
</
telerik:RadSchedulerContextMenu
>
</
AppointmentContextMenus
>
<%--<
AppointmentContextMenuSettings
EnableDefault
=
"true"
/>--%>
</
telerik:RadScheduler
>
<
br
/>
<
telerik:RadPanelBar
runat
=
"server"
ExpandMode
=
"SingleExpandedItem"
Width
=
"100%"
AllowCollapseAllItems
=
"true"
ID
=
"rpBar2"
Skin
=
"Outlook"
>
<
Items
>
<
telerik:RadPanelItem
Text="<%$ Resources:Calendar, pnlTasks %>" Expanded="True"
TabIndex="1">
<
Items
>
<
telerik:RadPanelItem
>
<
ItemTemplate
>
<
div
style
=
"padding: 10px"
>
<
table
width
=
"100%"
cellpadding
=
"2"
cellspacing
=
"2"
>
<
tr
>
<
td
style
=
"width: 75px"
>
<
asp:Label
ID
=
"lblSubject"
runat
=
"server"
Text="<%$ Resources:Calendar, lblSubject %>"></
asp:Label
>
</
td
>
<
td
style
=
"width: 300px"
>
<
telerik:RadTextBox
ID
=
"rtbSubject"
runat
=
"server"
Skin
=
"Outlook"
Width
=
"250px"
>
</
telerik:RadTextBox
>
</
td
>
<
td
style
=
"width: 50px"
>
</
td
>
<
td
style
=
"width: 75px"
>
<
asp:Label
ID
=
"lblClient"
runat
=
"server"
Text="<%$ Resources:Calendar, lblClient %>"></
asp:Label
>
</
td
>
<
td
style
=
"width: 300px"
>
<
telerik:RadComboBox
ID
=
"rcbClient"
runat
=
"server"
Skin
=
"Outlook"
Width
=
"250px"
Height
=
"150px"
OffsetX
=
"10"
OffsetY
=
"15"
>
</
telerik:RadComboBox
>
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"width: 75px"
>
<
asp:Label
ID
=
"lblDeal"
runat
=
"server"
Text="<%$ Resources:Calendar, lblDeal %>"></
asp:Label
>
</
td
>
<
td
style
=
"width: 300px"
>
<
telerik:RadTextBox
ID
=
"rtbDeal"
runat
=
"server"
Skin
=
"Outlook"
Width
=
"250px"
>
</
telerik:RadTextBox
>
</
td
>
<
td
style
=
"width: 50px"
>
</
td
>
<
td
style
=
"width: 75px"
>
<
asp:Label
ID
=
"lblActivityType"
runat
=
"server"
Text="<%$ Resources:Calendar, lblActivityType %>"></
asp:Label
>
</
td
>
<
td
style
=
"width: 300px"
>
<
telerik:RadComboBox
ID
=
"rcbActivityType"
runat
=
"server"
Skin
=
"Outlook"
Width
=
"250px"
Height
=
"150px"
OffsetX
=
"10"
OffsetY
=
"15"
>
</
telerik:RadComboBox
>
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"width: 75px"
>
<
asp:Label
ID
=
"lblDueDate"
runat
=
"server"
Text="<%$ Resources:Calendar, lblDueDate %>"></
asp:Label
>
</
td
>
<
td
style
=
"width: 300px"
>
<
telerik:RadDatePicker
ID
=
"rdpDueDate"
runat
=
"server"
Skin
=
"Outlook"
Width
=
"255px"
>
</
telerik:RadDatePicker
>
</
td
>
<
td
style
=
"width: 50px"
>
</
td
>
<
td
style
=
"width: 75px"
>
<
asp:Label
ID
=
"lblPriority"
runat
=
"server"
Text="<%$ Resources:Calendar, lblPriority %>"></
asp:Label
>
</
td
>
<
td
style
=
"width: 300px"
>
<
telerik:RadComboBox
ID
=
"rcbPriority"
runat
=
"server"
Skin
=
"Outlook"
Width
=
"250px"
Height
=
"150px"
OffsetX
=
"10"
OffsetY
=
"15"
>
</
telerik:RadComboBox
>
</
td
>
</
tr
>
<
tr
>
<
td
colspan
=
"5"
align
=
"left"
>
<
asp:Label
ID
=
"lblMessage"
Text="<%$ Resources:Calendar, lblMessage %>" runat="server"
Font-Size="X-Small" Font-Names="Tahoma" ForeColor="Red" Visible="false" Font-Bold="true" />
</
td
>
</
tr
>
<
tr
>
<
td
colspan
=
"5"
align
=
"center"
>
<
asp:Button
ID
=
"BtnSearchTasks"
Text="<%$ Resources:Calendar, BtnSearch %>" runat="server"
OnClick="BtnSearchTasks_Click" ValidationGroup="vgSearch" />
</
td
>
</
tr
>
</
table
>
</
div
>
</
ItemTemplate
>
</
telerik:RadPanelItem
>
</
Items
>
</
telerik:RadPanelItem
>
</
Items
>
</
telerik:RadPanelBar
>
<
br
/>
<
telerik:RadGrid
ID
=
"gdvTasks"
runat
=
"server"
AllowFilteringByColumn
=
"false"
GridLines
=
"None"
AutoGenerateColumns
=
"False"
AutoGenerateEditColumn
=
"false"
AutoGenerateDeleteColumn
=
"false"
AllowPaging
=
"True"
AllowSorting
=
"True"
OnNeedDataSource
=
"gdvTasks_NeedDataSource"
OnItemCreated
=
"gdvTasks_ItemCreated"
Skin
=
"Outlook"
Width
=
"100%"
OnColumnCreated
=
"gdvTasks_ColumnCreated"
OnItemCommand
=
"gdvTasks_ItemCommand"
OnItemDataBound
=
"gdvTasks_ItemDataBound"
>
<
MasterTableView
DataKeyNames
=
"ID"
EditMode
=
"PopUp"
AllowMultiColumnSorting
=
"True"
Name
=
"gdvTasks"
CommandItemDisplay
=
"Bottom"
PagerStyle-AlwaysVisible
=
"true"
TableLayout
=
"Fixed"
EnableViewState
=
"false"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"subject"
HeaderText="<%$ Resources:Calendar, gbcTask %>"
UniqueName="subject" HeaderStyle-Width="200px" FilterControlWidth="115px" />
<
telerik:GridDateTimeColumn
DataField
=
"dueDate"
DataType
=
"System.DateTime"
HeaderText="<%$ Resources:Calendar, lblDueDate %>"
UniqueName="dueDate" HeaderStyle-Width="150px" FilterControlWidth="80px" />
<
telerik:GridBoundColumn
DataField
=
"priority"
HeaderText="<%$ Resources:Calendar, lblPriority %>"
UniqueName="priority" HeaderStyle-Width="150px" FilterControlWidth="100px" />
<
telerik:GridBoundColumn
DataField
=
"completedDate"
HeaderText
=
"completedDate"
UniqueName
=
"completedDate"
HeaderStyle-Width
=
"150px"
FilterControlWidth
=
"100px"
Visible
=
"false"
/>
<
telerik:GridTemplateColumn
AllowFiltering
=
"False"
UniqueName
=
"TemplateColumn"
HeaderStyle-Width
=
"300px"
>
<
ItemTemplate
>
<
asp:LinkButton
ID
=
"btnEdit"
runat
=
"server"
CommandName
=
"Edit"
Text="<%$ Resources:Calendar, lbEdit %>"></
asp:LinkButton
>
<
asp:LinkButton
ID
=
"btnDelete"
runat
=
"server"
CommandName
=
"Delete"
Text="<%$ Resources:Calendar, lbDelete %>"></
asp:LinkButton
>
<
asp:LinkButton
ID
=
"btnComplete"
runat
=
"server"
CommandName
=
"SetComplete"
Text="<%$ Resources:Calendar, lbComplete %>"></
asp:LinkButton
>
</
ItemTemplate
>
<
ItemStyle
Wrap
=
"False"
/>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
>
<
Selecting
AllowRowSelect
=
"true"
EnableDragToSelectRows
=
"true"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
</
div
>
</
form
>
</
body
>
</
html
>
This is the source code of my page. If you need any new info I am ready to provide you with.
Imports
Telerik.Web.UI
Imports
System.Data
Imports
System.Collections.Generic
Imports
System.Reflection
Imports
System.Threading
Imports
System.Globalization
Partial
Class
Calendar
Inherits
System.Web.UI.Page
Private
Const
AppointmentsKey
As
String
=
""
Private
rpItem
As
RadPanelItem
Private
rpItemTasks
As
RadPanelItem
#Region "Scheduler"
Private
ReadOnly
Property
Appointments()
As
List(Of AppointmentInfo)
Get
Dim
sessApts
As
List(Of AppointmentInfo) = TryCast(Session(AppointmentsKey), List(Of AppointmentInfo))
If
sessApts
Is
Nothing
Then
sessApts =
New
List(Of AppointmentInfo)()
Session(AppointmentsKey) = sessApts
End
If
Return
sessApts
End
Get
End
Property
Protected
Overrides
Sub
InitializeCulture()
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Session(
"Culture"
).ToString)
Thread.CurrentThread.CurrentUICulture =
New
CultureInfo(Session(
"Culture"
).ToString)
MyBase
.InitializeCulture()
End
Sub
Protected
Sub
Page_Load(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
Me
.Load
rpItem = rpBar1.Items(0).Items(0)
rpItemTasks = rpBar2.Items(0).Items(0)
radScheduler.Culture =
New
CultureInfo(Session(
"Culture"
).ToString)
If
Not
IsPostBack
Then
Session.Remove(AppointmentsKey)
Dim
clsCalander
As
New
CalanderClass
Dim
dtClient
As
New
DataTable
Dim
dtPriority
As
New
DataTable
Dim
dtActivity
As
New
DataTable
dtClient = clsCalander.GetClientList(Session(
"Broker"
).ToString)
dtPriority = clsCalander.GetPriorityList(Session(
"Culture"
).ToString)
dtActivity = clsCalander.GetActivityTypeList(Session(
"Culture"
).ToString)
Dim
rcbClient
As
RadComboBox = TryCast(rpItem.FindControl(
"rcbClient"
), RadComboBox)
Dim
rcbClientTask
As
RadComboBox = TryCast(rpItemTasks.FindControl(
"rcbClient"
), RadComboBox)
Dim
rcbPriority
As
RadComboBox = TryCast(rpItemTasks.FindControl(
"rcbPriority"
), RadComboBox)
Dim
rcbActivity
As
RadComboBox = TryCast(rpItemTasks.FindControl(
"rcbActivityType"
), RadComboBox)
BindDDL(rcbClient, dtClient,
"ClientID"
,
"FullName"
)
BindDDL(rcbClientTask, dtClient,
"ClientID"
,
"FullName"
)
BindDDL(rcbPriority, dtPriority,
"itemValue"
,
"itemText"
)
BindDDL(rcbActivity, dtActivity,
"itemValue"
,
"itemText"
)
Session(
"AppointmentsKey"
) = ConvertToList(Of AppointmentInfo)(clsCalander.GetAppointments(
"ID,Subject,Start,[End],RecurrenceRule,RecurrenceParentID,Notes,ApptType,Location,Contact"
, Session(
"Broker"
).ToString, radScheduler.VisibleRangeStart.ToString(
"MM/dd/yyyy"
), radScheduler.VisibleRangeEnd.ToString(
"MM/dd/yyyy"
)))
'InitializeResources()
InitializeAppointments()
radScheduler.DataSource = Appointments
gdvTasks.Rebind()
End
If
End
Sub
Private
Sub
InitializeAppointments()
'For Each app As Appointment In DirectCast(Session("AppointmentsKey"), List(Of Appointment))
' Appointments.Add(New AppointmentInfo(app))
'Next
For
Each
app
As
AppointmentInfo
In
DirectCast
(Session(
"AppointmentsKey"
), List(Of AppointmentInfo))
Appointments.Add(app)
Next
End
Sub
Private
Function
FindById(
ByVal
ID
As
Integer
)
As
AppointmentInfo
For
Each
ai
As
AppointmentInfo
In
Appointments
If
ai.ID.Equals(ID)
Then
Return
ai
End
If
Next
Return
Nothing
End
Function
Protected
Sub
radScheduler_AppointmentCreated(
ByVal
sender
As
Object
,
ByVal
e
As
AppointmentCreatedEventArgs)
'Dim AppType As Resource = e.Appointment.Resources.GetResourceByType("ApptType")
'Dim ddlAppType As RadComboBox = DirectCast(e.Container.FindControl("ApptType"), RadComboBox)
'Dim clsCalander As New CalanderClass
'ddlAppType.DataValueField = "ApptType"
'ddlAppType.DataTextField = "Description"
'ddlAppType.DataSource = clsCalander.GetAppointmentTypes()
'ddlAppType.DataBind()
'If e.Appointment.RecurrenceState = RecurrenceState.Master OrElse e.Appointment.RecurrenceState = RecurrenceState.Occurrence Then
' Dim recurrenceStateDiv As New Panel()
' recurrenceStateDiv.CssClass = "rsAptRecurrence"
' e.Container.Controls.AddAt(0, recurrenceStateDiv)
'End If
'If e.Appointment.RecurrenceState = RecurrenceState.Exception Then
' Dim recurrenceStateDiv As New Panel()
' recurrenceStateDiv.CssClass = "rsAptRecurrenceException"
' e.Container.Controls.AddAt(0, recurrenceStateDiv)
'End If
End
Sub
Protected
Sub
radScheduler_NavigationComplete(
ByVal
sender
As
Object
,
ByVal
e
As
SchedulerNavigationCompleteEventArgs)
Dim
clsCalendar
As
New
CalanderClass
Session.Remove(
"AppointmentsKey"
)
Appointments.Clear()
Session(
"AppointmentsKey"
) = ConvertToList(Of AppointmentInfo)(clsCalendar.GetAppointments(
"ID,Subject,Start,[End],RecurrenceRule,RecurrenceParentID,Notes,ApptType,Location,Contact"
, Session(
"Broker"
).ToString, radScheduler.VisibleRangeStart.ToString(
"MM/dd/yyyy"
), radScheduler.VisibleRangeEnd.ToString(
"MM/dd/yyyy"
)))
InitializeAppointments()
radScheduler.DataSource = Appointments
gdvTasks.Rebind()
'rpItemTasks = rpBar2.Items(0).Items(0)
'Dim rdpDueDate As RadDatePicker = TryCast(rpItemTasks.FindControl("rdpDueDate"), RadDatePicker)
'rdpDueDate.DateInput.MinDate = radScheduler.VisibleRangeStart
'rdpDueDate.DateInput.MaxDate = radScheduler.VisibleRangeEnd
'rdpDueDate.DateInput.SelectedDate = radScheduler.VisibleRangeStart
End
Sub
Protected
Sub
radScheduler_NavigationCommand(
ByVal
sender
As
Object
,
ByVal
e
As
SchedulerNavigationCommandEventArgs)
Handles
radScheduler.NavigationCommand
'If e.Command = SchedulerNavigationCommand.NavigateToNextPeriod Then
' Dim clsCalendar As New CalanderClass
' Session.Remove("AppointmentsKey")
' Appointments.Clear()
' If radScheduler.SelectedView = SchedulerViewType.WeekView Then
' Session("AppointmentsKey") = ConvertToList(Of AppointmentInfo)(clsCalendar.GetAppointments("ID,Subject,Start,[End],RecurrenceRule,RecurrenceParentID,Notes,ApptType,Location,Contact", Session("Broker").ToString, radScheduler.VisibleRangeStart.AddDays(7).ToString, radScheduler.VisibleRangeEnd.AddDays(7).ToString))
' ElseIf radScheduler.SelectedView = SchedulerViewType.DayView Then
' Session("AppointmentsKey") = ConvertToList(Of AppointmentInfo)(clsCalendar.GetAppointments("ID,Subject,Start,[End],RecurrenceRule,RecurrenceParentID,Notes,ApptType,Location,Contact", Session("Broker").ToString, radScheduler.VisibleRangeStart.AddDays(1).ToString, radScheduler.VisibleRangeEnd.AddDays(1).ToString))
' ElseIf radScheduler.SelectedView = SchedulerViewType.MonthView Then
' Session("AppointmentsKey") = ConvertToList(Of AppointmentInfo)(clsCalendar.GetAppointments("ID,Subject,Start,[End],RecurrenceRule,RecurrenceParentID,Notes,ApptType,Location,Contact", Session("Broker").ToString, radScheduler.VisibleRangeStart.AddMonths(1).ToString, radScheduler.VisibleRangeEnd.AddMonths(1).ToString))
' End If
' InitializeAppointments()
' radScheduler.DataSource = Appointments
'ElseIf e.Command = SchedulerNavigationCommand.NavigateToPreviousPeriod Then
' Dim clsCalendar As New CalanderClass
' Session.Remove("AppointmentsKey")
' Appointments.Clear()
' If radScheduler.SelectedView = SchedulerViewType.WeekView Then
' Session("AppointmentsKey") = ConvertToList(Of AppointmentInfo)(clsCalendar.GetAppointments("ID,Subject,Start,[End],RecurrenceRule,RecurrenceParentID,Notes,ApptType,Location,Contact", Session("Broker").ToString, radScheduler.VisibleRangeStart.AddDays(-7).ToString, radScheduler.VisibleRangeEnd.AddDays(-7).ToString))
' ElseIf radScheduler.SelectedView = SchedulerViewType.DayView Then
' Session("AppointmentsKey") = ConvertToList(Of AppointmentInfo)(clsCalendar.GetAppointments("ID,Subject,Start,[End],RecurrenceRule,RecurrenceParentID,Notes,ApptType,Location,Contact", Session("Broker").ToString, radScheduler.VisibleRangeStart.AddDays(-1).ToString, radScheduler.VisibleRangeEnd.AddDays(-1).ToString))
' ElseIf radScheduler.SelectedView = SchedulerViewType.MonthView Then
' Session("AppointmentsKey") = ConvertToList(Of AppointmentInfo)(clsCalendar.GetAppointments("ID,Subject,Start,[End],RecurrenceRule,RecurrenceParentID,Notes,ApptType,Location,Contact", Session("Broker").ToString, radScheduler.VisibleRangeStart.AddMonths(-1).ToString, radScheduler.VisibleRangeEnd.AddMonths(-1).ToString))
' End If
' InitializeAppointments()
' radScheduler.DataSource = Appointments
'End If
End
Sub
Protected
Sub
radScheduler_FormCreated(
ByVal
sender
As
Object
,
ByVal
e
As
SchedulerFormCreatedEventArgs)
'If e.Container.Mode = SchedulerFormMode.AdvancedEdit Then
' Dim appInfo As New AppointmentInfo
' appInfo = FindById(e.Appointment.ID)
' Dim rcbType As RadComboBox = DirectCast(e.Container.FindControl("rcbType"), RadComboBox)
' rcbType.SelectedValue = appInfo.ApptType
'End If
End
Sub
Protected
Sub
radScheduler_AppointmentDataBound(
ByVal
sender
As
Object
,
ByVal
e
As
SchedulerEventArgs)
Handles
radScheduler.AppointmentDataBound
End
Sub
Protected
Sub
radScheduler_AppointmentInsert(
ByVal
sender
As
Object
,
ByVal
e
As
SchedulerCancelEventArgs)
Appointments.Add(
New
AppointmentInfo(e.Appointment))
Dim
AppInfo
As
New
AppointmentInfo()
AppInfo = FindById(0)
Dim
intType
As
Int64 = Convert.ToInt64(
DirectCast
(
DirectCast
(e.Appointment, Telerik.Web.UI.Appointment).Attributes, System.Web.UI.AttributeCollection).Item(
"ApptType"
))
Dim
Contact
As
Int64 = Convert.ToInt64(
DirectCast
(
DirectCast
(e.Appointment, Telerik.Web.UI.Appointment).Attributes, System.Web.UI.AttributeCollection).Item(
"Contact"
))
Dim
Location
As
String
=
DirectCast
(
DirectCast
(e.Appointment, Telerik.Web.UI.Appointment).Attributes, System.Web.UI.AttributeCollection).Item(
"Location"
)
Dim
Description
As
String
=
DirectCast
(
DirectCast
(e.Appointment, Telerik.Web.UI.Appointment).Attributes, System.Web.UI.AttributeCollection).Item(
"Description"
)
Dim
clsCalander
As
New
CalanderClass
Dim
RecParentID
As
Integer
If
AppInfo.RecurrenceParentID
Is
Nothing
Then
RecParentID = 0
Else
RecParentID = AppInfo.RecurrenceParentID
End
If
clsCalander.InsertAppointment(Session(
"Broker"
).ToString, AppInfo.Subject, AppInfo.Start, AppInfo.
End
, AppInfo.RecurrenceRule, RecParentID, intType, Description, Location, Contact)
Session.Remove(
"AppointmentsKey"
)
Appointments.Clear()
Session(
"AppointmentsKey"
) = ConvertToList(Of AppointmentInfo)(clsCalander.GetAppointments(
"ID,Subject,Start,[End],RecurrenceRule,RecurrenceParentID,Notes,ApptType,Location,Contact"
, Session(
"Broker"
).ToString, radScheduler.VisibleRangeStart.ToString(
"MM/dd/yyyy"
), radScheduler.VisibleRangeEnd.ToString(
"MM/dd/yyyy"
)))
'InitializeResources()
InitializeAppointments()
radScheduler.DataSource = Appointments
End
Sub
Protected
Sub
radScheduler_AppointmentUpdate(
ByVal
sender
As
Object
,
ByVal
e
As
AppointmentUpdateEventArgs)
Handles
radScheduler.AppointmentUpdate
'Dim ai As AppointmentInfo = FindById(e.ModifiedAppointment.ID.ToString())
'ai.CopyInfo(e.ModifiedAppointment)
Dim
AppInfo
As
New
AppointmentInfo()
AppInfo = FindById(e.ModifiedAppointment.ID.ToString)
AppInfo.CopyInfo(e.ModifiedAppointment)
Dim
intType
As
Int64 = Convert.ToInt64(
DirectCast
(
DirectCast
(e.ModifiedAppointment, Telerik.Web.UI.Appointment).Attributes, System.Web.UI.AttributeCollection).Item(
"ApptType"
))
Dim
Contact
As
Int64 = Convert.ToInt64(
DirectCast
(
DirectCast
(e.ModifiedAppointment, Telerik.Web.UI.Appointment).Attributes, System.Web.UI.AttributeCollection).Item(
"Contact"
))
Dim
Location
As
String
=
DirectCast
(
DirectCast
(e.ModifiedAppointment, Telerik.Web.UI.Appointment).Attributes, System.Web.UI.AttributeCollection).Item(
"Location"
)
Dim
Description
As
String
=
DirectCast
(
DirectCast
(e.ModifiedAppointment, Telerik.Web.UI.Appointment).Attributes, System.Web.UI.AttributeCollection).Item(
"Description"
)
Dim
clsCalander
As
New
CalanderClass
Dim
RecParentID
As
Integer
If
AppInfo.RecurrenceParentID
Is
Nothing
Then
RecParentID = 0
Else
RecParentID = AppInfo.RecurrenceParentID
End
If
clsCalander.UpdateAppointment(
DirectCast
(e.Appointment.ID, Int64), Session(
"Broker"
).ToString, AppInfo.Subject, AppInfo.Start, AppInfo.
End
, AppInfo.RecurrenceRule, RecParentID, intType, Description, Location, Contact)
Session.Remove(
"AppointmentsKey"
)
Appointments.Clear()
Session(
"AppointmentsKey"
) = ConvertToList(Of AppointmentInfo)(clsCalander.GetAppointments(
"ID,Subject,Start,[End],RecurrenceRule,RecurrenceParentID,Notes,ApptType,Location,Contact"
, Session(
"Broker"
).ToString, radScheduler.VisibleRangeStart.ToString(
"MM/dd/yyyy"
), radScheduler.VisibleRangeEnd.ToString(
"MM/dd/yyyy"
)))
'InitializeResources()
InitializeAppointments()
radScheduler.DataSource = Appointments
End
Sub
Protected
Sub
radScheduler_AppointmentDelete(
ByVal
sender
As
Object
,
ByVal
e
As
SchedulerCancelEventArgs)
Handles
radScheduler.AppointmentDelete
Dim
clsCalander
As
New
CalanderClass
clsCalander.DeleteAppointment(e.Appointment.ID)
Appointments.Remove(FindById(e.Appointment.ID.ToString()))
End
Sub
Protected
Sub
BtnSearch_Click(
ByVal
sender
As
Object
,
ByVal
e
As
EventArgs)
rpItem = rpBar1.Items(0).Items(0)
Dim
rcbClient
As
RadComboBox = TryCast(rpItem.FindControl(
"rcbClient"
), RadComboBox)
Dim
rtbSubject
As
RadTextBox = TryCast(rpItem.FindControl(
"rtbSubject"
), RadTextBox)
Dim
clsCalander
As
New
CalanderClass
Session.Remove(
"AppointmentsKey"
)
Appointments.Clear()
Session(
"AppointmentsKey"
) = ConvertToList(Of AppointmentInfo)(clsCalander.GetAppointmentsFiltered(
"ID,Subject,Start,[End],RecurrenceRule,RecurrenceParentID,Notes,ApptType,Location,Contact"
, Session(
"Broker"
).ToString, radScheduler.VisibleRangeStart.ToString(
"MM/dd/yyyy"
), radScheduler.VisibleRangeEnd.ToString(
"MM/dd/yyyy"
), rtbSubject.Text, rcbClient.SelectedValue))
'InitializeResources()
InitializeAppointments()
radScheduler.DataSource = Appointments
End
Sub
Public
Shared
Function
ConvertToList(Of T
As
{
Class
,
New
})(
ByVal
dt
As
DataTable)
As
IList(Of T)
If
dt
Is
Nothing
OrElse
dt.Rows.Count = 0
Then
Return
Nothing
End
If
Dim
list
As
IList(Of T) =
New
List(Of T)()
For
Each
row
As
DataRow
In
dt.Rows
Dim
obj
As
T = ConvertDataRowToEntity(Of T)(row)
list.Add(obj)
Next
Return
list
End
Function
Public
Shared
Function
ConvertDataRowToEntity(Of T
As
{
Class
,
New
})(
ByVal
row
As
DataRow)
As
T
Dim
objType
As
Type =
GetType
(T)
Dim
obj
As
T = Activator.CreateInstance(Of T)()
'hence the new() contsraint
'Debug.WriteLine(objType.Name + " = new " + objType.Name + "();");
For
Each
column
As
DataColumn
In
row.Table.Columns
'may error if no match
Dim
[property]
As
PropertyInfo = objType.GetProperty(column.ColumnName, BindingFlags.[
Public
]
Or
BindingFlags.Instance
Or
BindingFlags.IgnoreCase)
If
[property]
Is
Nothing
OrElse
Not
[property].CanWrite
Then
'Debug.WriteLine("//Property " + column.ColumnName + " not in object");
'or throw
Continue
For
End
If
Dim
value
As
Object
= row(column.ColumnName)
If
value
Is
DBNull.Value
Then
value =
Nothing
End
If
[property].SetValue(obj, value,
Nothing
)
Next
Return
obj
End
Function
Public
Sub
BindDDL(
ByVal
ddl
As
RadComboBox,
ByVal
source
As
[
Object
],
ByVal
dataValueField
As
String
,
ByVal
dataTextField
As
String
)
ddl.DataValueField = dataValueField
ddl.DataTextField = dataTextField
ddl.DataSource = source
ddl.DataBind()
ddl.Items.Insert(0,
New
RadComboBoxItem(
" "
,
"-1"
))
End
Sub
Public
Sub
New
()
End
Sub
#End Region
#Region "Tasks"
Protected
Sub
gdvTasks_NeedDataSource(
ByVal
source
As
Object
,
ByVal
e
As
GridNeedDataSourceEventArgs)
Dim
clsCalendar
As
New
CalanderClass
gdvTasks.DataSource = clsCalendar.GetTaskListByAgent(Session(
"Broker"
).ToString, radScheduler.VisibleRangeStart.ToString(
"MM/dd/yyyy"
), radScheduler.VisibleRangeEnd.AddDays(-1).ToString(
"MM/dd/yyyy"
), Session(
"Culture"
).ToString,
String
.Empty,
"Agent"
)
End
Sub
Protected
Sub
gdvTasks_ItemDataBound(
ByVal
sender
As
Object
,
ByVal
e
As
GridItemEventArgs)
If
e.Item.OwnerTableView.Name =
"gdvTasks"
Then
If
TypeOf
e.Item
Is
GridDataItem
Then
Dim
drv
As
DataRowView =
DirectCast
(e.Item.DataItem, DataRowView)
If
drv(
"completedDate"
) IsNot System.DBNull.Value
Then
e.Item.Controls(6).Controls(5).Visible =
False
End
If
End
If
End
If
End
Sub
Protected
Sub
gdvTasks_ColumnCreated(
ByVal
sender
As
Object
,
ByVal
e
As
GridColumnCreatedEventArgs)
'If (e.OwnerTableView.Name = "gdvTasks") Then
' If e.Column.ColumnType = "GridButtonColumn" Then
' Dim gbcDelete As GridButtonColumn = DirectCast(e.Column, GridButtonColumn)
' gbcDelete.Text = "Test" 'GetLocalResourceObject("gdv.DeleteButtonColumn.DeleteText").ToString()
' gbcDelete.ConfirmText = "Are you sure you want to delete this item?" 'GetLocalResourceObject("gdv.DeleteButtonColumn.ConfirmText").ToString()
' gbcDelete.Visible = False
' End If
'End If
End
Sub
Protected
Sub
gdvTasks_ItemCommand(
ByVal
source
As
Object
,
ByVal
e
As
GridCommandEventArgs)
If
e.CommandName =
"Edit"
Then
Session(
"TaskInsert"
) =
"false"
e.Canceled =
True
Dim
strTaskID
As
String
= TryCast(e.Item, GridDataItem).GetDataKeyValue(
"ID"
).ToString()
OpenTaskWindow(strTaskID)
Dim
drv
As
DataRowView =
DirectCast
(e.Item.DataItem, DataRowView)
If
e.Item.Controls(6).Controls(5).Visible =
False
Then
Session(
"Completed"
) =
"false"
Else
Session(
"Completed"
) =
"true"
End
If
'Response.Write("<script type='text/javascript'>detailedresults=window.open('form.aspx?xml=tasks/TaskDetail.xml&TaskID=" + strTaskID + "');</script>")
ElseIf
e.CommandName =
"Delete"
Then
Dim
TaskID
As
Int64 = TryCast(e.Item, GridDataItem).GetDataKeyValue(
"ID"
).ToString()
Dim
clsCalendar
As
New
CalanderClass
clsCalendar.DeleteTask(TaskID)
gdvTasks.Rebind()
e.Canceled =
True
ElseIf
e.CommandName =
"SetComplete"
Then
Dim
TaskID
As
String
= TryCast(e.Item, GridDataItem).GetDataKeyValue(
"ID"
).ToString()
Dim
windowManager
As
New
RadWindowManager()
Dim
widnow1
As
New
RadWindow()
' Set the window properties
widnow1.NavigateUrl =
"form.aspx?xml=tasks/CompleteTask.xml&TaskID="
+ TaskID
widnow1.Skin =
"Outlook"
widnow1.ID =
"RadWindow1"
widnow1.Width = Unit.Pixel(490)
widnow1.Height = Unit.Pixel(200)
widnow1.VisibleTitlebar =
False
widnow1.Modal =
True
widnow1.VisibleOnPageLoad =
True
'widnow1.ReloadOnShow = True
' Set this property to True for showing window from code
windowManager.Windows.Add(widnow1)
Me
.form1.Controls.Add(widnow1)
ElseIf
e.CommandName =
"InitInsert"
Then
Session(
"TaskInsert"
) =
"true"
e.Canceled =
True
Dim
strTaskID
As
String
Dim
clsCalendar
As
New
CalanderClass
Session(
"Completed"
) =
"true"
strTaskID = clsCalendar.InsertTask(Session(
"Broker"
).ToString, Session(
"Culture"
).ToString)
OpenTaskWindow(strTaskID)
End
If
'ElseIf e.CommandName = "Update" Then
'ElseIf e.CommandName = "Save" Then
' gdvScheduleHeader.Rebind()
'ElseIf e.CommandName = "RebindGrid" Then
' hidDeletedIDs.Value = InlineAssignHelper(hidID.Value, String.Empty)
'ElseIf e.Item.OwnerTableView.Name = String.Empty Then
' hidDeletedIDs.Value = InlineAssignHelper(hidID.Value, String.Empty)
'End If
'End If
End
Sub
Private
Sub
OpenTaskWindow(
ByVal
TaskID
As
String
)
Dim
windowManager
As
New
RadWindowManager()
Dim
widnow1
As
New
RadWindow()
' Set the window properties
widnow1.NavigateUrl =
"form.aspx?xml=tasks/TaskDetail.xml&TaskID="
+ TaskID
widnow1.Skin =
"Outlook"
widnow1.ID =
"RadWindow1"
widnow1.Width = Unit.Pixel(750)
widnow1.Height = Unit.Pixel(600)
widnow1.VisibleTitlebar =
False
widnow1.Modal =
True
'widnow1.Title = "Edit Task"
widnow1.VisibleOnPageLoad =
True
'widnow1.ReloadOnShow = True
' Set this property to True for showing window from code
windowManager.Windows.Add(widnow1)
Me
.form1.Controls.Add(widnow1)
End
Sub
Protected
Sub
gdvTasks_ItemCreated(
ByVal
sender
As
Object
,
ByVal
e
As
GridItemEventArgs)
If
TypeOf
e.Item
Is
GridCommandItem
Then
Dim
cmditm
As
GridCommandItem =
DirectCast
(e.Item, GridCommandItem)
Dim
btn1
As
Button =
DirectCast
(cmditm.FindControl(
"AddNewRecordButton"
), Button)
btn1.Visible =
False
'e.Item.FindControl("RefreshButton").Parent.Visible = False
End
If
If
TypeOf
e.Item
Is
GridPagerItem
Then
'Dim lbPageSize As Label = DirectCast(e.Item.FindControl("ChangePageSizeLabel"), Label)
'If lbPageSize IsNot Nothing Then
' lbPageSize.Text = HttpContext.GetGlobalResourceObject("CommonResources", "PageSizeText").ToString()
' 'IO
'End If
Dim
lbPageSize
As
Button =
DirectCast
(e.Item.FindControl(
"ctl03"
), Button)
lbPageSize.ToolTip = HttpContext.GetGlobalResourceObject(
"Calendar"
,
"PrevPageToolTip"
).ToString()
End
If
End
Sub
Protected
Sub
BtnSearchTasks_Click(
ByVal
sender
As
Object
,
ByVal
e
As
EventArgs)
rpItemTasks = rpBar2.Items(0).Items(0)
Dim
rcbClientTask
As
RadComboBox = TryCast(rpItemTasks.FindControl(
"rcbClient"
), RadComboBox)
Dim
rcbPriority
As
RadComboBox = TryCast(rpItemTasks.FindControl(
"rcbPriority"
), RadComboBox)
Dim
rcbActivity
As
RadComboBox = TryCast(rpItemTasks.FindControl(
"rcbActivityType"
), RadComboBox)
Dim
rtbSubject
As
RadTextBox = TryCast(rpItemTasks.FindControl(
"rtbSubject"
), RadTextBox)
Dim
rtbDeal
As
RadTextBox = TryCast(rpItemTasks.FindControl(
"rtbDeal"
), RadTextBox)
Dim
rdpDueDate
As
RadDatePicker = TryCast(rpItemTasks.FindControl(
"rdpDueDate"
), RadDatePicker)
Dim
lblMessage
As
Label = TryCast(rpItemTasks.FindControl(
"lblMessage"
), Label)
lblMessage.Visible =
False
Dim
dt
As
String
If
rdpDueDate.SelectedDate
Is
Nothing
Or
(rdpDueDate.SelectedDate >= radScheduler.VisibleRangeStart
And
rdpDueDate.SelectedDate <= radScheduler.VisibleRangeEnd)
Then
If
rdpDueDate.SelectedDate
Is
Nothing
Then
dt =
"1/1/1910"
Else
dt = rdpDueDate.SelectedDate.Value.ToString(
"MM/dd/yyyy"
)
End
If
Dim
clsCalander
As
New
CalanderClass
gdvTasks.DataSource = clsCalander.GetTaskListByAgentFiltered(Session(
"Broker"
).ToString, dt, rtbDeal.Text, rcbPriority.SelectedValue, rcbActivity.SelectedValue, rtbSubject.Text, Session(
"Culture"
).ToString, radScheduler.VisibleRangeStart.ToString(
"MM/dd/yyyy"
), radScheduler.VisibleRangeEnd.ToString(
"MM/dd/yyyy"
))
gdvTasks.DataBind()
Else
lblMessage.Visible =
True
End
If
End
Sub
#End Region
End
Class
#Region "Appointment Info"
Class
AppointmentInfo
Private
_id
As
String
Private
_subject
As
String
Private
_start
As
DateTime
Private
_end
As
DateTime
Private
_recurrenceRule
As
String
Private
_recurrenceParentId
As
System.Nullable(Of
Integer
)
Private
_notes
As
String
Private
_appType
As
String
Private
_location
As
String
Private
_userID
As
System.Nullable(Of
Integer
)
Public
Property
ID()
As
Int64
Get
Return
_id
End
Get
Set
(
ByVal
value
As
Int64)
_id = value
End
Set
End
Property
Public
Property
Subject()
As
String
Get
Return
_subject
End
Get
Set
(
ByVal
value
As
String
)
_subject = value
End
Set
End
Property
Public
Property
Start()
As
DateTime
Get
Return
_start
End
Get
Set
(
ByVal
value
As
DateTime)
_start = value
End
Set
End
Property
Public
Property
[
End
]()
As
DateTime
Get
Return
_end
End
Get
Set
(
ByVal
value
As
DateTime)
_end = value
End
Set
End
Property
Public
Property
RecurrenceRule()
As
String
Get
Return
_recurrenceRule
End
Get
Set
(
ByVal
value
As
String
)
_recurrenceRule = value
End
Set
End
Property
Public
Property
RecurrenceParentID()
As
System.Nullable(Of
Integer
)
Get
Return
_recurrenceParentId
End
Get
Set
(
ByVal
value
As
System.Nullable(Of
Integer
))
_recurrenceParentId = value
End
Set
End
Property
Public
Property
Notes()
As
String
Get
Return
_notes
End
Get
Set
(
ByVal
value
As
String
)
_notes = value
End
Set
End
Property
Public
Property
ApptType()
As
Integer
Get
Return
_appType
End
Get
Set
(
ByVal
value
As
Integer
)
_appType = value
End
Set
End
Property
Public
Property
Location()
As
String
Get
Return
_location
End
Get
Set
(
ByVal
value
As
String
)
_location = value
End
Set
End
Property
Public
Property
Contact()
As
System.Nullable(Of Int64)
Get
Return
_userID
End
Get
Set
(
ByVal
value
As
System.Nullable(Of Int64))
_userID = value
End
Set
End
Property
Public
Sub
New
()
'Me._id = Guid.NewGuid().ToString()
End
Sub
Public
Sub
New
(
ByVal
subject
As
String
,
ByVal
start
As
DateTime,
ByVal
[end]
As
DateTime,
ByVal
recurrenceRule
As
String
,
ByVal
recurrenceParentID
As
String
,
ByVal
userID
As
System.Nullable(Of
Integer
))
Me
.
New
()
Me
._subject = subject
Me
._start = start
Me
._end = [end]
Me
._recurrenceRule = recurrenceRule
Me
._recurrenceParentId = recurrenceParentID
'Me._userID = userID
Me
._appType = ApptType
End
Sub
Public
Sub
New
(
ByVal
source
As
Appointment)
Me
.
New
()
CopyInfo(source)
End
Sub
Public
Sub
CopyInfo(
ByVal
source
As
Appointment)
Subject = source.Subject
Start = source.Start
[
End
] = source.[
End
]
RecurrenceRule = source.RecurrenceRule
If
source.RecurrenceParentID IsNot
Nothing
Then
RecurrenceParentID = source.RecurrenceParentID.ToString()
End
If
End
Sub
End
Class
#End Region
Thank you Lana in advance. I appreciate your help a lot.
0
Hello elais,
Try modifying the RadAjaxmanager declaration as below:
Regards,
Iana
the Telerik team
Try modifying the RadAjaxmanager declaration as below:
<
telerik:RadAjaxManager
runat
=
"server"
ID
=
"RadAjaxManager1"
ClientEvents-OnRequestStart
=
"conditionaPostback"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"radScheduler"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"radScheduler"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"gdvTasks"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"rdpDueDate"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"gdvTasks"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"gdvTasks"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"windowManager"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
Regards,
Iana
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.