Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
104 views
Hi,

I want to add new commands to the RibbonBar inside the RibbonBar's ButtonClick event handler. Unfortunately, this doesn't seem to work as they are server-side added, but aren't visible on the client.

How I can I achieve this?

Thanks!

Edit: The ribbon bar is used in an AjaxManager:
AjaxSetting ajaxSetting1 = new AjaxSetting(m_ribbonBar.ID);
ajaxSetting1.UpdatedControls.Add(new AjaxUpdatedControl(m_contentPanel.ID, loadingPanel.ID) { UpdatePanelHeight = new Unit("100%") });
RadAjaxManager1.AjaxSettings.Add(ajaxSetting1);

In the ButtonClick event (in the same case where it is necessary that the ribbon bar changes), the m_contentPanel (it is just a div) is cleared and another control is added to the content panel.
When I try to add commands to the RibbonBar, the LoadingPanel also never disappears in the m_contentPanel. If I just add the new control without changed the RibbonBar, the LoadingPanel disappears and the control is displayed correctly.
Bozhidar
Telerik team
 answered on 02 Dec 2011
0 answers
51 views
Hi!
We are currently using the Upload control on some custom modules (old RadUpload v. 2.4.7.0) with no problems. The DotNetNuke installation version is 05.06.02 with Italian as default site language; the english (US) language is also installed and currently disabled. We encountered the following very strange issue: if we enable the english language RadUpload stop working; only very small files (tried with sizes smaller that 1kb) are uploaded but larger files not anymore. No errors visualized or recorded anywhere cause the code do something only if UploadedFileCount is greater than 0 but it returns 0 (it returns the correct file count only with very small files).
Any idea?
Thank you.
Robin
Top achievements
Rank 1
 asked on 02 Dec 2011
1 answer
83 views
Our grid is currently set to use inline editing. As such, it has an EditCommandColumn with an image button that, when clicked, turns the BoundColumns into text boxes for editing and the EditCommandColumn into two image buttons to update or cancel. This is pretty standard. What we'd like to do is this: When the edit image is clicked, our javascript lightbox (specifically jQuery Colorbox) pops up containing the text boxes for the columns that can be edited, along with the update and cancel buttons.

I'm not sure of the best way to structure the grid in order to do this. I've been searching around for a while and have just been going in circles. Any help would be much appreciated.
Antonio Stoilkov
Telerik team
 answered on 02 Dec 2011
9 answers
246 views
I've spent days trying to solve what shoud be a very simple thing - getting a bit frustrated now as could acheive this with "regualr" ajax and asp.net, but totally lost with Telerik! Hopefully just ignorance on my part...

I have  tree view control which will be the navigation. It sits in a rad splitter on the left side. On the right side is the area that will be affected by clicks on my tree view. For example, a tree view click will load one of various screens in the right side pane depending upon which node is clicked - be that a form for entering a survey question or a form for reordering survey sections....

It all works well - a tree view node click leaves the tree view on screen, while the form in the right side pane loads, a cool little loading panel displaying as I wait. But here's the problem...

One operation I want to perform is drag and drop reordering of nodes on the client side - this requires a post back  / server event  so I can refesh the tree view. In this case the tree view will need to do a full post back and completely refresh itself. The problem is that I cannot filter events and therefore when I attempt this my node clicks also beging to do full post backs causing y tree view to dissapear!

The event filter on radajaxmanager does not work, despite (seemingly) conflicting posts I've seen in this forum. And using ajaxManager.ajaxRequestWithTarget and/or ajaxManager.ajaxRequest seems to provide no resolution (mostly errors, limitations and frustration at how little documentation there is on this)

Any help at all would be appreciated ...





Iana Tsolova
Telerik team
 answered on 02 Dec 2011
2 answers
211 views
I have a radtreeview inside an UpdatePanel in the bottom there are 3 LinkButton each one inside an UpdatePanel. Each time you uncheck a node the radtreeview do a postback and refreshes the entire page. What I want to achieve is that when you uncheck a node does not refresh the entire page. So I want the buttons are not refresh and if it is possible not to refresh the radtreeview when do the postback. This is the code I use to do that but not working because it refreshes the whole page.

function OnClientNodeChecking(sender, args) {  
        
        if (!args.get_node().get_checked())
        {
            var treeView = $find("<%=trTaxonomy.ClientID%>");  
            treeView.trackChanges();
            args.get_node().set_checked(true);  
            args.set_cancel(true);  
            treeView.commitChanges();
            alert(args.get_node().get_checked());
                        
         }
         if (args.get_node().get_checked())         
         {
            args.set_cancel(true);
         }
      }  
      
      function onNodeChecked(sender, e) {      
        var node = e.get_node();        
        if (node.get_checked()) {
            sender._postBackOnCheck = false;
        }
        
        setTimeout(function() { sender._postBackOnCheck = true; }, 100);
    }             
</
script>
    <asp:ScriptManager ID="ManageLinesScriptManager" runat="server">
    </asp:ScriptManager>
     
     
    <table style="height: 100%; Width:100%;">
        <tr style="Width:100%; height:90%;">
            <td>
                <div style="overflow:auto; height:100%; width:100%;">
                    <asp:UpdatePanel ID="UpdatePanel4" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="True">
                        <ContentTemplate>
                            <telerik:RadTreeView CheckBoxes="true"
                                AllowNodeEditing="true"
                                ID="trTaxonomy"
                                runat="server"                       
                                OnNodeExpand="trTaxonomy_NodeExpand"
                                OnClientContextMenuShowing="menuShowing"
                                OnClientContextMenuItemClicked="itemClicked"
                                OnNodeEdit="trTaxonomy_NodeEdit"
                                OnClientNodeEditStart="EditNode"
                                OnNodeCheck="trTaxonomy_NodeCheck"
                                OnClientNodeChecked="onNodeChecked" style="overflow:visible">
                                <ContextMenus>
                                    <telerik:RadTreeViewContextMenu ID="RadTreeViewContextMenuAdd" runat="server"
                                        EnableEmbeddedScripts="true">
                                        <Items>
                                            <telerik:RadMenuItem Text="Add" Value="1" />
                                        </Items>
                                    </telerik:RadTreeViewContextMenu>
                                    <telerik:RadTreeViewContextMenu ID="RadTreeViewContextMenuDelete" runat="server"
                                        EnableEmbeddedScripts="true">
                                        <Items>
                                            <telerik:RadMenuItem Text="Delete" Value="2" />
                                        </Items>
                                    </telerik:RadTreeViewContextMenu>
                                </ContextMenus>
                            </telerik:RadTreeView>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                     
                </div>
            </td>
        </tr>
        <tr style="Width:100%; height:10%; vertical-align:middle" align="center">
            <td valign="middle">
                    <table align="center" style="vertical-align:middle;" >
                        <tr valign="middle">
                            <td valign="middle">
                                <div class="Content">
                                    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="True">
                                        <ContentTemplate>
                                            <asp:LinkButton ID="btnOk" runat="server" CssClass="InlineButton" Text="Save"  OnClick="btnOK_Click" Height="10px" />
                                        </ContentTemplate>   
                                    </asp:UpdatePanel>   
                                </div>
                            </td>
                            <td valign="middle">
                                <div class="Content">
                                    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="True">
                                        <ContentTemplate>
                                            <asp:LinkButton ID="btnSaveClose" runat="server" CssClass="InlineButton" Text="Save & Close"  Width="90px" OnClick="btnSaveClose_Click" Height="10px" />
                                        </ContentTemplate>   
                                    </asp:UpdatePanel>    
                                </div>
                            </td>
                            <td valign="middle">
                                <div class="Content">
                                    <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="True">
                                        <ContentTemplate>
                                            <asp:LinkButton ID="btnCancel" runat="server" CssClass="InlineButton" Text="Cancel" OnClientClick="ShowWarning(); return false;" Height="10px"/>                       
                                        </ContentTemplate>   
                                    </asp:UpdatePanel>   
                                </div>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
Andres
Top achievements
Rank 1
 answered on 02 Dec 2011
3 answers
221 views
Hi

I am trying to write some code which will loop through a RadGrid and find any RadNumericTextBox in the dit template.

The code below works for the first row in the grid but no any others. Any ideas?
Thanks in advance

function ConvertToDegreeMinutesSeconds_Grid(Longitude, Latitude) {
var rgrdRouteWayPoints = $find("<%=rgrdRouteWayPoints.ClientID %>");
 if (rgrdRouteWayPoints) {
                        var MasterTable = rgrdRouteWayPoints.get_masterTableView();
                        var Rows = MasterTable.get_dataItems();
                        for (var i = 0; i < Rows.length; i++) {
                            var row = Rows[i];
         
                            var rtxtLongDegree_Grid = row.findControl("rtxtLongDegree_Grid");
                                                        
                            var rtxtLongMin_Grid = row.findControl("rtxtLongMin_Grid");
                            var rtxtLongSec_Grid = row.findControl("rtxtLongSec_Grid");

                            var rtxtLatDegree_Grid = row.findControl("rtxtLatDegree_Grid");
                            var rtxtLatMin_Grid = row.findControl("rtxtLatMin_Grid");
                            var rtxtLatSec_Grid = row.findControl("rtxtLatSec_Grid");

                            rtxtLongDegree_Grid.set_value(Longitude_Deg);
                            rtxtLongMin_Grid.set_value(Longitude_Min);
                            rtxtLongSec_Grid.set_value(Longitude_Sec);

                            rtxtLatDegree_Grid.set_value(Latitude_Deg);
                            rtxtLatMin_Grid.set_value(Latitude_Min);
                            rtxtLatSec_Grid.set_value(Latitude_Sec);
 
                        }
                    }

                }

                function rcbPortList_Grid_Changed(sender, args) {
                    //copy port long/lat to input boxes
                    var item = args.get_item();
                    var Longitude = item.get_attributes().getAttribute("Longitude");
                    var Latitude = item.get_attributes().getAttribute("Latitude");

                    ConvertToDegreeMinutesSeconds_Grid(Longitude, Latitude);

                }
Ajay
Top achievements
Rank 1
 answered on 02 Dec 2011
2 answers
92 views
Hi,
I have searched through the API, the demos and the forum, but I have found no
way at all to let a RibbonBarMenu object show it's current selected item (like a
standard DropDownList would do). I'm using a menu like this in the
QuickAccess menu and need to show the current selected item (at least the
text) either on the menu itself or on a label. Is there any way to
accomplish this?

I guess that the following thread is almost the same, except that it's about the ribbonbartogglelist:

Thanks!
Bozhidar
Telerik team
 answered on 02 Dec 2011
5 answers
283 views
Hi I'm setting up a RadScheduler to handle appointments from a SQL DB.
My interface includes, for each appointment, a lot of additional datas so i decided to use AdvancedEditTemplate and AdvancedInsertTemplate to build the appointment interface. Everything went fine till I put a RadSchedulerRecurrenceEditor in the interface to handle Recurring Events.
The problem is here described:
- If I open a simple appointment (no recurrences) and add a recurrence the event get saved correctly.
- if I open an event with recurrences and try to modify the recurrence the event does not get saved...in the sense that the recurrences does not get saved and remain the previous scheduling.

The problem seems to be that when i click the LB_Save LinkButton that triggers the Command "Update" (which is handled by the 

RadScheduler.AppointmentCommand) the event FormCreated gets triggered first and the RadSchedulerRecurrenceEditor.RecurrenceRuleText gets reloaded before it gets Updated....so basically i save again the RecurrenceRule that is already saved. What is strange is that if the Appointment does not contain any RecurrenceRule the new RecurrenceRule gets saved correctly.

I'm out of good ideas on this one. Follows the code.

Scheduler.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Scheduler.aspx.vb" Inherits="Admin_Scheduler" %>
 
<%@ Register src="Header.ascx" tagname="Header" tagprefix="uc" %>
<%@ Register src="Left.ascx" tagname="Left" tagprefix="uc" %>
<%@ Register src="Footer.ascx" tagname="Footer" tagprefix="uc" %>
 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title>CecchiPoint</title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager" runat="server" />
    <link type="text/css" href="../Resources/StyleBase.css" rel="Stylesheet" />
<telerik:RadScriptBlock runat="server">
<script type="text/javascript" language="javascript">
 
    function Move(sender, eventArgs) {
        var Start = eventArgs.get_newStartTime().format("yyyy/MM/dd HH:mm");
         
        var apt = eventArgs.get_appointment();
        var IdReservation = apt.get_id();
         
        $find("<%=RadAjaxManager.ClientID %>").ajaxRequest('Move|' + Start + '|' + IdReservation);
    }
    function Resize(sender, eventArgs) {
        var Time = eventArgs.get_newTime().format("yyyy/MM/dd HH:mm");
 
        var apt = eventArgs.get_appointment();
        var IdReservation = apt.get_id();
 
        $find("<%=RadAjaxManager.ClientID %>").ajaxRequest('Resize|' + Time + '|' + IdReservation);
    }
</script>
</telerik:RadScriptBlock>
</head>
 
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" EnableScriptLocalization="true" EnableScriptGlobalization="true"></telerik:RadScriptManager>
         
    <div id="DIV_Main">
        <div id="DIV_Header" class="Titolo1">
 
        <uc:Header runat="server" Title="Servizio prenotazioni" />
 
        </div>
 
        <div id="DIV_Left">
             
            <uc:Left ID="Left" runat="server" />
             
        </div>
 
        <div id="DIV_Filter">
        <telerik:RadToolBar runat="server" Width="100%" Height="32px" ID="RadToolBar_Filter">
            <Items>
                <telerik:RadToolBarButton Text="Filtro prenotazioni: " Enabled="false"></telerik:RadToolBarButton>
                <telerik:RadToolBarButton Value="Spazi">
                    <ItemTemplate>
                        <asp:CheckBox runat="server" ID="Ck_Spazi" Text="Spazi" TextAlign="Right" AutoPostBack="true" Checked="true" />  
                    </ItemTemplate>
                </telerik:RadToolBarButton>
                <telerik:RadToolBarButton Value="Mezzi">
                    <ItemTemplate>
                        <asp:CheckBox runat="server" ID="Ck_Mezzi" Text="Mezzi" TextAlign="Right" AutoPostBack="true" Checked="true" />  
                    </ItemTemplate>
                </telerik:RadToolBarButton>
                <telerik:RadToolBarButton Value="Servizi">
                    <ItemTemplate>
                        <asp:CheckBox runat="server" ID="Ck_Servizi" Text="Servizi" TextAlign="Right" AutoPostBack="true" Checked="true" />
                    </ItemTemplate>
                </telerik:RadToolBarButton>
            </Items>
        </telerik:RadToolBar>
             
        </div>
 
        <div id="DIV_Body">
             
            <telerik:RadAjaxManager runat="server" ID="RadAjaxManager" DefaultLoadingPanelID="LP">
                <AjaxSettings>
                     
                    <telerik:AjaxSetting AjaxControlID="RadScheduler">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadScheduler" UpdatePanelHeight="100%" />
                            <telerik:AjaxUpdatedControl ControlID="RadAjaxManager" UpdatePanelHeight="100%" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                     
                    <telerik:AjaxSetting AjaxControlID="Ck_Spazi">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadScheduler" UpdatePanelHeight="100%" />
                            <telerik:AjaxUpdatedControl ControlID="RadAjaxManager" UpdatePanelHeight="100%" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="Ck_Mezzi">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadScheduler" UpdatePanelHeight="100%" />
                            <telerik:AjaxUpdatedControl ControlID="RadAjaxManager" UpdatePanelHeight="100%" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="Ck_Servizi">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadScheduler" UpdatePanelHeight="100%" />
                            <telerik:AjaxUpdatedControl ControlID="RadAjaxManager" UpdatePanelHeight="100%" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
 
            <telerik:RadAjaxLoadingPanel runat="server" ID="LP" MinDisplayTime="500" Transparency="0" ZIndex="80000" Width="100%" Height="100%">
                 
            </telerik:RadAjaxLoadingPanel>          
    
               <telerik:RadScheduler ID="RadScheduler" runat="server" Width="100%" Height="100%"
             EnableDescriptionField="True" StartEditingInAdvancedForm="true"
             StartInsertingInAdvancedForm="true" SelectedView="MonthView"
             DayStartTime="07:00" DayEndTime="20:00" AppointmentStyleMode="Default"
             DataKeyField="IdReservation" DataStartField="DateFrom" DataEndField="DateTo"
             DataSubjectField="Subject" CustomAttributeNames="Color" DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID"
             OnClientAppointmentMoveEnd="Move" OnClientAppointmentResizeEnd="Resize"
             TimeSlotContextMenuSettings-EnableDefault="true" AppointmentContextMenuSettings-EnableDefault="true">
               
             
             <TimeSlotContextMenus>
               <telerik:RadSchedulerContextMenu ID="SchedulerTimeSlotContextMenu" runat="server">
                   <Items>
                       <telerik:RadMenuItem Text="Nuovo nolo" Value="CommandAddAppointment" ImageUrl="../Resources/Images/ico_ServiceAdd_16.png" />              
                       <%--
                       <telerik:RadMenuItem Text="New All Day Event" />
                       <telerik:RadMenuItem IsSeparator="True" />
                       <telerik:RadMenuItem Text="New Recurring Appointment" Value="CommandAddRecurringAppointment" />
                       <telerik:RadMenuItem Text="New Recurring Event" />
                       <telerik:RadMenuItem IsSeparator="True" />--%>
                       <telerik:RadMenuItem Text="Vai a Oggi" Value="CommandGoToToday" />
                       <%--<telerik:RadMenuItem Text="Show 24 hours..." Value="CommandShow24Hours" />--%>
                   </Items>
               </telerik:RadSchedulerContextMenu>
            </TimeSlotContextMenus>
 
             <AdvancedInsertTemplate>
                <div style="padding:2px;border:1px solid #C3C3C3;padding:4px;">
                    <table cellpadding="0" cellspacing="0px" width="100%" border="0">
                        <%--<tr>
                            <td class="CellLabel">Descrizione: (*) 
                                <asp:RequiredFieldValidator ValidationGroup="VG0" runat="server" ControlToValidate="T_Subject" ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator>
                            </td>
                            <td class="CellData">
                                <telerik:RadTextBox runat="server" ID="T_Subject" Width="90%"></telerik:RadTextBox>
                            </td>
                        </tr>--%>
                        <tr>
                            <td class="CellLabel">Da: (*) 
                                <asp:RequiredFieldValidator ValidationGroup="VG0" runat="server" ControlToValidate="DTP_DateFrom" ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator>
                            </td>
                            <td class="CellData">
                                <telerik:RadDateTimePicker runat="server" ID="DTP_DateFrom" DateInput-Width="80px" TimeView-Interval="00:15:00" TimeView-Columns="4"></telerik:RadDateTimePicker>
                                  A: (*) 
                                <asp:RequiredFieldValidator ValidationGroup="VG0" runat="server" ControlToValidate="DTP_DateTo" ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator>
                                <telerik:RadDateTimePicker runat="server" ID="DTP_DateTo" DateInput-Width="80px" TimeView-Interval="00:15:00" TimeView-Columns="4"></telerik:RadDateTimePicker>
                            </td>
                        </tr>
                        <tr>
                            <td class="CellLabel">Nolo: (*) 
                                <asp:RequiredFieldValidator ValidationGroup="VG0" runat="server" ControlToValidate="T_Service" ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator>
                            </td>
                            <td class="CellData">
                                 
                                <div style="float:left;width:380px">
                                <asp:HiddenField runat="server" ID="HF_IdService" Value="" />
                               <telerik:RadTextBox ReadOnly="true" runat="server" ID="T_Service" Width="350px"></telerik:RadTextBox>
                                <asp:HyperLink runat="server" ID="HL_Service">
                                    <asp:Image runat="server" ImageUrl="~/Resources/Images/ico_View_16.png" ImageAlign="AbsMiddle" />
                                </asp:HyperLink>
                                </div>
                                <div style="float:left"><asp:Panel runat="server" ID="P_ServiceColor" Width="30px" Height="20px"></asp:Panel></div>
                                <div style="clear:both">
                                 
                            </td>
                        </tr>
                        <tr>
                            <td class="CellLabel">Assegnatario: (*) 
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" ValidationGroup="VG0" runat="server" ControlToValidate="T_Customer" ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator>
                            </td>
                            <td class="CellData">
                                <asp:HiddenField runat="server" ID="HF_IdCustomer" Value="" />
                                <telerik:RadTextBox ReadOnly="true" runat="server" ID="T_Customer" Width="350px"></telerik:RadTextBox>
 
                                <asp:HyperLink runat="server" ID="HL_Customer">
                                    <asp:Image runat="server" ImageUrl="~/Resources/Images/ico_View_16.png" ImageAlign="AbsMiddle" />
                                </asp:HyperLink>
                            </td>
                        </tr>
                        <tr>
                            <td class="CellLabel">Valore del servizio: </td>
                            <td class="CellData">
                                <telerik:RadNumericTextBox ReadOnly="true" runat="server" ID="T_CostDue" Type="Currency" NumberFormat-DecimalDigits="2" EnabledStyle-HorizontalAlign="Right" Width="80px"></telerik:RadNumericTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="CellLabel">Costo riparazione: </td>
                            <td class="CellData">
                                <telerik:RadNumericTextBox runat="server" ID="T_RepairCost" Type="Currency" NumberFormat-DecimalDigits="2" EnabledStyle-HorizontalAlign="Right" Width="80px"></telerik:RadNumericTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="CellLabel">Quota saldata: </td>
                            <td class="CellData">
                                <telerik:RadNumericTextBox ReadOnly="true" runat="server" ID="T_CostPaid" Type="Currency" NumberFormat-DecimalDigits="2" EnabledStyle-HorizontalAlign="Right" Width="80px"></telerik:RadNumericTextBox>
                                
                            </td>
                        </tr>
                        <tr>
                            <td class="CellLabel">Quota residua: </td>
                            <td class="CellData">
                                <telerik:RadNumericTextBox ReadOnly="true" runat="server" ID="T_CostRemaining" Type="Currency" NumberFormat-DecimalDigits="2" EnabledStyle-HorizontalAlign="Right" Width="80px"></telerik:RadNumericTextBox>
                                
                            </td>
                        </tr>
                        <tr>
                            <td class="CellLabel">Stato contabile: 
                                <%--<asp:RequiredFieldValidator ValidationGroup="VG0" runat="server" ControlToValidate="CB_BillingStatus" ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator>--%>
                            </td>
                            <td class="CellData">
                                <telerik:RadComboBox runat="server" ID="CB_BillingStatus">
                                    <Items>
                                        <telerik:RadComboBoxItem Text="" Value="0" />
                                        <telerik:RadComboBoxItem value="1" Text="Nessun Saldo" />
                                        <telerik:RadComboBoxItem value="2" Text="Saldato parzialmente" />
                                        <telerik:RadComboBoxItem Value="3" Text="Saldato" />
                                    </Items>
                                </telerik:RadComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="CellLabel">Stato restituzione: 
                                <%--<asp:RequiredFieldValidator ValidationGroup="VG0" runat="server" ControlToValidate="CB_Status" ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator>--%>
                            </td>
                            <td class="CellData">
                                <telerik:RadComboBox runat="server" ID="CB_Status">
                                    <Items>
                                        <telerik:RadComboBoxItem Text="" Value="0" />
                                        <telerik:RadComboBoxItem value="1" Text="Consegnato" />
                                        <telerik:RadComboBoxItem value="2" Text="Restituito parzialmente" />
                                        <telerik:RadComboBoxItem Value="3" Text="Restituito" />
                                        <telerik:RadComboBoxItem Value="4" Text="Restituito da riparare" />
                                    </Items>
                                </telerik:RadComboBox>
                            </td>
                        </tr>
                         <tr>
                            <td colspan="2">
                                <telerik:RadSchedulerRecurrenceEditor ID="RecurrenceEditor" runat="server"></telerik:RadSchedulerRecurrenceEditor>
                            </td>
                        </tr>
                        <tr>
                            <td class="CellLabel"></td>
                            <td class="CellData" style="height:60px;vertical-align:bottom">
                            <div style="text-align:right;width:90%">
                                <asp:LinkButton runat="server" ID="LB_Save" CssClass="StyleSave" CommandName="Insert" ValidationGroup="VG0">
                                    <asp:Image runat="server" ImageUrl="~/Resources/Images/ico_check_16.png" ImageAlign="AbsMiddle" />
                                    <span>Salva</span>
                                </asp:LinkButton>
                                  
                                <asp:LinkButton runat="server" ID="LB_Close" CssClass="StyleClose" CommandName="Cancel" ValidationGroup="VG1">
                                    <asp:Image runat="server" ImageUrl="~/Resources/Images/ico_close_16.png" ImageAlign="AbsMiddle" />
                                    <span>Chiudi senza salvare</span>
                                </asp:LinkButton>
                            </div>
                            </td>
                        </tr>
                         
                    </table>
                     
                </div>
             </AdvancedInsertTemplate>
              
             <AdvancedEditTemplate>
                 
                  <telerik:RadToolBar ID="RadToolBar1" runat="server" Width="100%" Height="32px"></telerik:RadToolBar>
                   
                  <div style="border:1px solid #C3C3C3;padding:4px;">
                   
                    <table cellpadding="0" cellspacing="0px" width="100%" border="0" style="margin-top:6px">
                        <tr>
                            <td class="CellLabel">Da: (*) 
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ValidationGroup="VG0" runat="server" ControlToValidate="DTP_DateFrom" ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator>
                            </td>
                            <td class="CellData">
                                <telerik:RadDateTimePicker runat="server" ID="DTP_DateFrom" DateInput-Width="80px" TimeView-Interval="00:15:00" TimeView-Columns="4"></telerik:RadDateTimePicker>
                                  A: (*) 
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ValidationGroup="VG0" runat="server" ControlToValidate="DTP_DateTo" ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator>
                                <telerik:RadDateTimePicker runat="server" ID="DTP_DateTo" DateInput-Width="80px" TimeView-Interval="00:15:00" TimeView-Columns="4"></telerik:RadDateTimePicker>
                            </td>
                        </tr>
                        <tr>
                            <td class="CellLabel">Nolo: (*) 
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" ValidationGroup="VG0" runat="server" ControlToValidate="T_Service" ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator>
                            </td>
                            <td class="CellData">
                                
                                <div style="float:left;width:380px">
                                <asp:HiddenField runat="server" ID="HF_IdService" Value="" />
                               <telerik:RadTextBox ReadOnly="true" runat="server" ID="T_Service" Width="350px"></telerik:RadTextBox>
                                <asp:HyperLink runat="server" ID="HL_Service">
                                    <asp:Image ID="Image2" runat="server" ImageUrl="~/Resources/Images/ico_View_16.png" ImageAlign="AbsMiddle" />
                                </asp:HyperLink>
                                </div>
                                <div style="float:left"><asp:Panel runat="server" ID="P_ServiceColor" Width="30px" Height="22px"></asp:Panel></div>
                                <div style="clear:both">
                                 
                                 
                            </td>
                        </tr>
                        <tr>
                            <td class="CellLabel">Assegnatario: (*) 
                                <asp:RequiredFieldValidator ValidationGroup="VG0" runat="server" ControlToValidate="T_Customer" ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator>
                            </td>
                            <td class="CellData">
                                <asp:HiddenField runat="server" ID="HF_IdCustomer" Value="" />
                                <telerik:RadTextBox ReadOnly="true" runat="server" ID="T_Customer" Width="350px"></telerik:RadTextBox>
 
                                <asp:HyperLink runat="server" ID="HL_Customer">
                                    <asp:Image ID="Image3" runat="server" ImageUrl="~/Resources/Images/ico_View_16.png" ImageAlign="AbsMiddle" />
                                </asp:HyperLink>
                            </td>
                        </tr>
                        <tr>
                            <td class="CellLabel">Valore del servizio: </td>
                            <td class="CellData">
                                <telerik:RadNumericTextBox runat="server" ID="T_CostDue" Type="Currency" NumberFormat-DecimalDigits="2" EnabledStyle-HorizontalAlign="Right" Width="80px" MinValue="0"></telerik:RadNumericTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="CellLabel">Costo riparazione: </td>
                            <td class="CellData">
                                <telerik:RadNumericTextBox runat="server" ID="T_RepairCost" Type="Currency" NumberFormat-DecimalDigits="2" EnabledStyle-HorizontalAlign="Right" Width="80px"></telerik:RadNumericTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="CellLabel">Quota saldata: </td>
                            <td class="CellData">
                                <telerik:RadNumericTextBox ReadOnly="true" runat="server" ID="T_CostPaid" Type="Currency" NumberFormat-DecimalDigits="2" EnabledStyle-HorizontalAlign="Right" Width="80px"></telerik:RadNumericTextBox>
                                <asp:HyperLink runat="server" ID="HL_CostPaid">
                                    <asp:Image runat="server" ImageUrl="~/Resources/Images/ico_View_16.png" ImageAlign="AbsMiddle" />
                                    Gestisci pagamenti
                                </asp:HyperLink>
                            </td>
                        </tr>
                         
                         <tr>
                            <td class="CellLabel">Quota residua: </td>
                            <td class="CellData">
                                <telerik:RadNumericTextBox ReadOnly="true" runat="server" ID="T_CostRemaining" Type="Currency" NumberFormat-DecimalDigits="2" EnabledStyle-HorizontalAlign="Right" Width="80px"></telerik:RadNumericTextBox>
                                
                            </td>
                        </tr>
                        <tr>
                            <td class="CellLabel">Stato contabile: 
                                
                            </td>
                            <td class="CellData">
                                <telerik:RadComboBox runat="server" ID="CB_BillingStatus">
                                    <Items>
                                        <telerik:RadComboBoxItem Text="" Value="0" />
                                        <telerik:RadComboBoxItem value="1" Text="Nessun Saldo" />
                                        <telerik:RadComboBoxItem value="2" Text="Saldato parzialmente" />
                                        <telerik:RadComboBoxItem Value="3" Text="Saldato" />
                                    </Items>
                                </telerik:RadComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="CellLabel">Stato restituzione: 
                                
                            </td>
                            <td class="CellData">
                                <telerik:RadComboBox runat="server" ID="CB_Status">
                                    <Items>
                                        <telerik:RadComboBoxItem Text="" Value="0" />
                                        <telerik:RadComboBoxItem value="1" Text="Consegnato" />
                                        <telerik:RadComboBoxItem value="2" Text="Restituito parzialmente" />
                                        <telerik:RadComboBoxItem Value="3" Text="Restituito" />
                                        <telerik:RadComboBoxItem Value="4" Text="Restituito da riparare" />
                                    </Items>
                                </telerik:RadComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <telerik:RadSchedulerRecurrenceEditor ID="RecurrenceEditor" runat="server"></telerik:RadSchedulerRecurrenceEditor>
                            </td>
                        </tr>
                        <tr>
                            <td class="CellLabel"></td>
                            <td class="CellData" style="height:60px;vertical-align:bottom">
                            <div style="text-align:right;width:500px">
                                <asp:LinkButton runat="server" ID="LB_Save" CssClass="StyleSave" CommandName="Update" ValidationGroup="VG0">
                                    <asp:Image ID="Image4" runat="server" ImageUrl="~/Resources/Images/ico_check_16.png" ImageAlign="AbsMiddle" />
                                    <span>Salva</span>
                                </asp:LinkButton>
                                  
                                <asp:LinkButton runat="server" ID="LB_Close" CssClass="StyleClose" CommandName="Cancel" ValidationGroup="VG1">
                                    <asp:Image ID="Image5" runat="server" ImageUrl="~/Resources/Images/ico_close_16.png" ImageAlign="AbsMiddle" />
                                    <span>Chiudi senza salvare</span>
                                </asp:LinkButton>
                            </div>
                            </td>
                        </tr>
                         
                    </table>
                     
                </div>
             </AdvancedEditTemplate>       
 
            </telerik:RadScheduler>
             
        </div>
        <div id="DIV_Footer">
        <uc:Footer ID="Footer" runat="server" />
        </div>
    </div>
             
        
 
     
    </form>
</body>
</html>

Scheduler.aspx.vb
Imports Telerik.Web.UI
 
Partial Class Admin_Scheduler
    Inherits System.Web.UI.Page
 
    'Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
    '    RadScheduler.Provider = New XmlSchedulerProvider(Server.MapPath("~/App_Data/Appointments.xml"), True)
 
 
    'End Sub
    Private WithEvents Ck_Spazi As CheckBox = Nothing
    Private WithEvents Ck_Mezzi As CheckBox = Nothing
    Private WithEvents Ck_Servizi As CheckBox = Nothing
 
    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        Ck_Spazi = CType(RadToolBar_Filter.FindItemByValue("Spazi").FindControl("Ck_Spazi"), CheckBox)
        Ck_Mezzi = CType(RadToolBar_Filter.FindItemByValue("Mezzi").FindControl("Ck_Mezzi"), CheckBox)
        Ck_Servizi = CType(RadToolBar_Filter.FindItemByValue("Servizi").FindControl("Ck_Servizi"), CheckBox)
    End Sub
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 
        If Not IsPostBack Then
            BindScheduler()
        End If
    End Sub
 
    Private Sub BindScheduler()
        Dim oDaObReservation As New Cecchi.Elements.Reservation
 
        RadScheduler.DataSource = oDaObReservation.GetReservationTab(Ck_Spazi.Checked, Ck_Mezzi.Checked, Ck_Servizi.Checked)
        'RadScheduler.DataBind()
    End Sub
 
    Protected Sub RadScheduler_AppointmentCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.AppointmentCommandEventArgs) Handles RadScheduler.AppointmentCommand
        If e.CommandName = "Insert" Or e.CommandName = "Update" Then
 
            Dim DTP_DateFrom As RadDateTimePicker = DirectCast(e.Container.FindControl("DTP_DateFrom"), RadDateTimePicker)
            Dim DTP_DateTo As RadDateTimePicker = DirectCast(e.Container.FindControl("DTP_DateTo"), RadDateTimePicker)
            Dim HF_IdService As HiddenField = DirectCast(e.Container.FindControl("HF_IdService"), HiddenField)
            Dim T_Service As RadTextBox = DirectCast(e.Container.FindControl("T_Service"), RadTextBox)
            Dim HF_IdCustomer As HiddenField = DirectCast(e.Container.FindControl("HF_IdCustomer"), HiddenField)
            Dim T_CostDue As RadNumericTextBox = DirectCast(e.Container.FindControl("T_CostDue"), RadNumericTextBox)
            Dim T_CostPaid As RadNumericTextBox = DirectCast(e.Container.FindControl("T_CostPaid"), RadNumericTextBox)
            Dim CB_BillingStatus As RadComboBox = DirectCast(e.Container.FindControl("CB_BillingStatus"), RadComboBox)
            Dim CB_Status As RadComboBox = DirectCast(e.Container.FindControl("CB_Status"), RadComboBox)
            Dim T_RepairCost As RadNumericTextBox = DirectCast(e.Container.FindControl("T_RepairCost"), RadNumericTextBox)
            Dim RecurrenceEditor As RadSchedulerRecurrenceEditor = DirectCast(e.Container.FindControl("RecurrenceEditor"), RadSchedulerRecurrenceEditor)
 
            ' Valuto il costo del servizio
            Dim oDaObService As New Cecchi.Elements.DaObService
            oDaObService.PK.Add("IdService", CInt(HF_IdService.Value))
            Dim oService As Data.DataRow = oDaObService.Get
 
            Dim CostDue As Decimal = 0
 
            If oService IsNot Nothing Then
                If oService("RentType") = 0 Then
                    ' Costo orario
                    Dim Durata As TimeSpan = DTP_DateTo.SelectedDate - DTP_DateFrom.SelectedDate
                    'T_CostDue.Value = Durata.TotalHours * CDec(oService("FeePerHour"))
                    CostDue = Durata.TotalHours * CDec(oService("FeePerHour"))
 
                ElseIf oService("RentType") = 1 Then
                    ' Costo forfettario
                    'T_CostDue.Value = CDec(oService("FeeForfait"))
                    CostDue = CDec(oService("FeeForfait"))
                End If
            End If
 
            Select Case e.CommandName
                Case "Update"
 
                    Dim oDaObReservation As New Cecchi.Elements.Reservation
                    Dim oReservation = oDaObReservation.newDaObItem
                    oReservation("IdReservation") = New Guid(e.Container.Appointment.ID.ToString)
                    oReservation("DateFrom") = DTP_DateFrom.DbSelectedDate
                    oReservation("DateTo") = DTP_DateTo.DbSelectedDate
                    oReservation("Subject") = T_Service.Text
 
                    oReservation("IdService") = HF_IdService.Value
                    oReservation("IdCustomer") = HF_IdCustomer.Value
                    oReservation("CostDue") = IIf(T_CostDue.DbValue Is Nothing, 0, T_CostDue.DbValue)
                    oReservation("CostPaid") = IIf(T_CostPaid.DbValue Is Nothing, 0, T_CostPaid.DbValue)
                    oReservation("BillingStatus") = CB_BillingStatus.SelectedValue
                    oReservation("Status") = CB_Status.SelectedValue
                    oReservation("RepairCost") = IIf(T_RepairCost.DbValue Is Nothing, 0, T_RepairCost.DbValue)
 
                    RecurrenceEditor.StartDate = DTP_DateFrom.DbSelectedDate
                    RecurrenceEditor.EndDate = DTP_DateTo.DbSelectedDate
 
                    oReservation("RecurrenceRule") = RecurrenceEditor.RecurrenceRuleText
                    oReservation("RecurrenceParentID") = New Guid(e.Container.Appointment.ID.ToString)
 
                    oDaObReservation.Upd(oReservation)
                    BindScheduler()
 
                Case "Insert"
 
                    Dim oDaObReservation As New Cecchi.Elements.Reservation
                    Dim oReservation = oDaObReservation.newDaObItem
                    oReservation("IdReservation") = Guid.NewGuid
                    oReservation("DateFrom") = DTP_DateFrom.DbSelectedDate
                    oReservation("DateTo") = DTP_DateTo.DbSelectedDate
                    oReservation("Subject") = T_Service.Text
 
                    oReservation("IdService") = HF_IdService.Value
                    oReservation("IdCustomer") = HF_IdCustomer.Value
                    oReservation("CostDue") = CostDue
                    oReservation("CostPaid") = IIf(T_CostPaid.DbValue Is Nothing, 0, T_CostPaid.DbValue)
                    oReservation("BillingStatus") = CB_BillingStatus.SelectedValue
                    oReservation("Status") = CB_Status.SelectedValue
                    oReservation("RepairCost") = IIf(T_RepairCost.DbValue Is Nothing, 0, T_RepairCost.DbValue)
 
                    oDaObReservation.Add(oReservation)
                    BindScheduler()
 
                    Dim Script As String = ""
                    Script += "var Calendar = $find('" & RadScheduler.ClientID & "');"
                    Script += "var Appointments = Calendar.get_appointments();"
                    Script += "var Appointment = Appointments.findByID('" & oReservation("IdReservation").ToString & "');"
                    Script += "Calendar.editAppointment(Appointment);"
 
                    RadAjaxManager.ResponseScripts.Add(Script)
 
            End Select
 
        End If
    End Sub
 
    Protected Sub RadScheduler_AppointmentDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.SchedulerEventArgs) Handles RadScheduler.AppointmentDataBound
 
        e.Appointment.BackColor = System.Drawing.ColorTranslator.FromHtml(e.Appointment.Attributes("Color"))
 
    End Sub
 
    Protected Sub RadScheduler_AppointmentDelete(ByVal sender As Object, ByVal e As Telerik.Web.UI.AppointmentDeleteEventArgs) Handles RadScheduler.AppointmentDelete
        Dim oDaObReservation As New Cecchi.Elements.Reservation
        oDaObReservation.PK.Add("IdReservation", New Guid(e.Appointment.ID.ToString))
 
        oDaObReservation.Del()
        BindScheduler()
    End Sub
 
    Protected Sub RadScheduler_AppointmentUpdate(ByVal sender As Object, ByVal e As Telerik.Web.UI.AppointmentUpdateEventArgs) Handles RadScheduler.AppointmentUpdate
 
    End Sub
 
    'Protected Sub RadScheduler_AppointmentUpdate(ByVal sender As Object, ByVal e As Telerik.Web.UI.AppointmentUpdateEventArgs) Handles RadScheduler.AppointmentUpdate
 
 
    '' Gestisco Resize e Moove degli appuntamenti
    'Dim oDaObReservation As New Cecchi.Elements.Reservation
    'Dim oReservation = oDaObReservation.newDaObItem
    'oReservation("IdReservation") = e.ModifiedAppointment.ID
    'oReservation("DateFrom") = e.ModifiedAppointment.Start
    'oReservation("DateTo") = e.ModifiedAppointment.End
 
    'oDaObReservation.Upd(oReservation)
 
    'BindScheduler()
 
    ' End Sub
 
    Protected Sub RadScheduler_FormCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.SchedulerFormCreatedEventArgs) Handles RadScheduler.FormCreated
 
        Dim DTP_DateFrom As RadDateTimePicker = DirectCast(e.Container.FindControl("DTP_DateFrom"), RadDateTimePicker)
        Dim DTP_DateTo As RadDateTimePicker = DirectCast(e.Container.FindControl("DTP_DateTo"), RadDateTimePicker)
        Dim HF_IdService As HiddenField = DirectCast(e.Container.FindControl("HF_IdService"), HiddenField)
        Dim T_Service As RadTextBox = DirectCast(e.Container.FindControl("T_Service"), RadTextBox)
        Dim HF_IdCustomer As HiddenField = DirectCast(e.Container.FindControl("HF_IdCustomer"), HiddenField)
        Dim T_Customer As RadTextBox = DirectCast(e.Container.FindControl("T_Customer"), RadTextBox)
        Dim T_CostDue As RadNumericTextBox = DirectCast(e.Container.FindControl("T_CostDue"), RadNumericTextBox)
        Dim T_CostPaid As RadNumericTextBox = DirectCast(e.Container.FindControl("T_CostPaid"), RadNumericTextBox)
        Dim T_CostRemaining As RadNumericTextBox = DirectCast(e.Container.FindControl("T_CostRemaining"), RadNumericTextBox)
        Dim CB_BillingStatus As RadComboBox = DirectCast(e.Container.FindControl("CB_BillingStatus"), RadComboBox)
        Dim CB_Status As RadComboBox = DirectCast(e.Container.FindControl("CB_Status"), RadComboBox)
        Dim T_RepairCost As RadNumericTextBox = DirectCast(e.Container.FindControl("T_RepairCost"), RadNumericTextBox)
        Dim P_ServiceColor As Panel = DirectCast(e.Container.FindControl("P_ServiceColor"), Panel)
 
        Dim RecurrenceEditor As RadSchedulerRecurrenceEditor = DirectCast(e.Container.FindControl("RecurrenceEditor"), RadSchedulerRecurrenceEditor)
 
        Select Case e.Container.Mode
 
            Case SchedulerFormMode.AdvancedEdit
 
                Dim oDaObReservation As New Cecchi.Elements.Reservation
                oDaObReservation.PK.Add("IdReservation", New Guid(e.Appointment.ID.ToString))
                Dim oReservation As Data.DataRow = oDaObReservation.Get()
 
                If oReservation IsNot Nothing Then
                    DTP_DateFrom.DbSelectedDate = oReservation("DateFrom")
                    DTP_DateTo.DbSelectedDate = oReservation("DateTo")
                    T_Service.Text = oReservation("Subject")
 
                    ' Recupero i dati dell'Utente
                    Dim oDaObUser As New Cecchi.Elements.DaObUser
                    Dim oUser As Data.DataRow = oDaObUser.Get(oReservation("IdCustomer"))
                    If oUser IsNot Nothing Then
                        T_Customer.Text = oUser("RagioneSociale").ToString
                    End If
 
                    ' Recupero il colore del Service
                    Dim oDaObService As New Cecchi.Elements.DaObService
                    oDaObService.PK.Add("IdService", oReservation("IdService"))
                    Dim oService As Data.DataRow = oDaObService.Get
 
                    If oService IsNot Nothing Then
                        P_ServiceColor.BackColor = System.Drawing.ColorTranslator.FromHtml(oService("Color"))
                    End If
                    HF_IdService.Value = oReservation("IdService").ToString
                    HF_IdCustomer.Value = oReservation("IdCustomer").ToString
                    T_CostDue.DbValue = oReservation("CostDue")
                    T_RepairCost.DbValue = oReservation("RepairCost")
                    T_CostPaid.DbValue = oReservation("CostPaid")
                    T_CostRemaining.DbValue = oReservation("CostDue") + oReservation("RepairCost") - oReservation("CostPaid")
                    CB_BillingStatus.SelectedValue = oReservation("BillingStatus")
                    CB_Status.SelectedValue = oReservation("Status")
 
 
                    RecurrenceEditor.RecurrenceRuleText = oReservation("RecurrenceRule").ToString
                    RecurrenceEditor.StartDate = oReservation("DateFrom")
                    RecurrenceEditor.EndDate = oReservation("DateTo")
 
 
                    Dim HL_Service As HyperLink = DirectCast(e.Container.FindControl("HL_Service"), HyperLink)
                    HL_Service.NavigateUrl = "javascript:var W=window.open('p_ServiceSearch.aspx','','width=500px,height=500px')"
 
                    Dim HL_Customer As HyperLink = DirectCast(e.Container.FindControl("HL_Customer"), HyperLink)
                    HL_Customer.NavigateUrl = "javascript:var W=window.open('p_CustomerSearch.aspx','','width=500px,height=500px')"
 
                    Dim HL_CostPaid As HyperLink = DirectCast(e.Container.FindControl("HL_CostPaid"), HyperLink)
                    HL_CostPaid.NavigateUrl = "javascript:var W=window.open('p_Sales.aspx?IdReservation=" & e.Appointment.ID.ToString & "','','width=500px,height=500px')"
 
                End If
 
            Case SchedulerFormMode.AdvancedInsert
 
                DTP_DateFrom.SelectedDate = e.Appointment.Start
                DTP_DateTo.SelectedDate = e.Appointment.Start.AddHours(1)
 
                Dim HL_Service As HyperLink = DirectCast(e.Container.FindControl("HL_Service"), HyperLink)
                HL_Service.NavigateUrl = "javascript:var W=window.open('p_ServiceSearch.aspx','','width=500px,height=500px')"
 
                Dim HL_Customer As HyperLink = DirectCast(e.Container.FindControl("HL_Customer"), HyperLink)
                HL_Customer.NavigateUrl = "javascript:var W=window.open('p_CustomerSearch.aspx','','width=500px,height=500px')"
 
 
        End Select
 
    End Sub
 
    Protected Sub RadAjaxManager_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxManager.AjaxRequest
 
        Select Case e.Argument.Split("|")(0)
            Case "Move"
                Dim oDaObReservation As New Cecchi.Elements.Reservation
                oDaObReservation.PK.Add("IdReservation", New Guid(e.Argument.Split("|")(2)))
 
                Dim oReservation As Data.DataRow = oDaObReservation.Get
                Dim Durata As TimeSpan = CDate(oReservation("DateTo")).Subtract(oReservation("DateFrom"))
 
                oReservation("DateFrom") = CDate(e.Argument.Split("|")(1))
                oReservation("DateTo") = CDate(oReservation("DateFrom")) + Durata
 
                oDaObReservation.Upd(oReservation)
                BindScheduler()
            Case "Resize"
                Dim oDaObReservation As New Cecchi.Elements.Reservation
                oDaObReservation.PK.Add("IdReservation", New Guid(e.Argument.Split("|")(2)))
 
                Dim oReservation As Data.DataRow = oDaObReservation.Get
                Dim Gap As TimeSpan = CDate(e.Argument.Split("|")(1)).Subtract(oReservation("DateTo"))
                Dim Durata As TimeSpan = CDate(e.Argument.Split("|")(1)).Subtract(oReservation("DateFrom"))
 
                oReservation("DateTo") = CDate(oReservation("DateTo")) + Gap
 
                ' Valuto la variazione di costo
                Dim oDaObService As New Cecchi.Elements.DaObService
                oDaObService.PK.Add("IdService", oReservation("IdService"))
                Dim oService As Data.DataRow = oDaObService.Get
 
                If oService IsNot Nothing Then
                    If oService("RentType") = 0 Then
                        ' Costo orario
                        'Dim Durata As TimeSpan = DTP_DateTo.SelectedDate - DTP_DateFrom.SelectedDate
                        oReservation("CostDue") = Durata.TotalHours * CDec(oService("FeePerHour"))
                    End If
                End If
 
 
                oDaObReservation.Upd(oReservation)
                BindScheduler()
 
        End Select
    End Sub
 
    Protected Sub Ck_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Ck_Spazi.CheckedChanged, Ck_Mezzi.CheckedChanged, Ck_Servizi.CheckedChanged
        BindScheduler()
    End Sub
 
End Class

Ivana
Telerik team
 answered on 02 Dec 2011
1 answer
208 views
Hello,

i have a problem with calling ClientScript.RegisterStartupScript(this.Page.GetType(), "OpenReport", popupScript);
in a page that contain a radblock, could you help me please, does ClientScript.RegisterStartupScript has any problem with telerik components

thank!


Slav
Telerik team
 answered on 02 Dec 2011
5 answers
640 views

I'm trying to use a client-site row click to fire a custom item command and I'm not sure how to go about it. I have a GridButtonColumn that allows the user to run the command however we need to have the entire row clickable. I can have the row go into edit mode when clicked but that isn't what we are looking for. Here is the code I have so far:

<telerik:RadCodeBlock ID="rcbCode" runat="server">
    <script type="text/javascript">
        function RowClick(sender, eventArgs) {
            var editedRow = eventArgs.get_itemIndexHierarchical();
            $find("<%=rgStudents.MasterTableView.ClientID %>").editItem(editedRow);
        }
    </script>
</telerik:RadCodeBlock>
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" CellSpacing="0"
    GridLines="None" OnDeleteCommand="RadGrid1_DeleteCommand" OnInsertCommand="RadGrid1_InsertCommand"
    OnItemCommand="RadGrid1_ItemCommand" OnItemDataBound="RadGrid1_ItemDataBound"
    OnNeedDataSource="RadGrid1_NeedDataSource">
    <ClientSettings EnableRowHoverStyle="true">
        <ClientEvents OnRowClick="RowClick" />
    </ClientSettings>
    <MasterTableView CommandItemDisplay="Bottom" InsertItemDisplay="Bottom">
        <Columns>
            <telerik:GridBoundColumn DataField="ID" DataType="System.Guid" FilterControlAltText="Filter ID column"
                HeaderText="ID" UniqueName="ID" Display="False" ReadOnly="True" ForceExtractValue="Always"
                Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="name" Display="False" FilterControlAltText="Filter name column"
                HeaderText="Name" UniqueName="name">
            </telerik:GridBoundColumn>
            <telerik:GridButtonColumn CommandName="StartProcess"
                ButtonType="LinkButton" FilterControlAltText="Filter StartProcess column"
                Text="Start Process" UniqueName="StartProcess">
            </telerik:GridButtonColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

This opens the row in edit mode but what I'm really looking for is to call the "StartProcess" item command the same way the last GridButtonColumn does.

Marin
Telerik team
 answered on 02 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?